From 083a03710ae0dedfe2fcc595c05ba5693cce487d Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sat, 9 May 2015 18:34:11 +1200 Subject: [PATCH] Remove no-op calls to swig_incref(). Python and Perl were calling this from the Director constructor, but swig_disown_flag is always false at that point, so the call doesn't do anything. --- Lib/perl5/director.swg | 1 - Lib/python/director.swg | 1 - 2 files changed, 2 deletions(-) diff --git a/Lib/perl5/director.swg b/Lib/perl5/director.swg index 714a87877..acdd5c3d8 100644 --- a/Lib/perl5/director.swg +++ b/Lib/perl5/director.swg @@ -233,7 +233,6 @@ namespace Swig { char *str = SvPV(pkg, len); swig_class = std::string(str, len); swig_self = newRV_inc((SV *)newHV()); - swig_incref(); } /* discard our reference at destruction */ diff --git a/Lib/python/director.swg b/Lib/python/director.swg index 6e69e544c..f745f3fca 100644 --- a/Lib/python/director.swg +++ b/Lib/python/director.swg @@ -330,7 +330,6 @@ namespace Swig { public: /* wrap a python object, optionally taking ownership */ Director(PyObject *self) : swig_self(self), swig_disown_flag(false) { - swig_incref(); } /* discard our reference at destruction */