#342 Fix for bug 1301

None
closed
None
5
2013-07-01
2013-06-25
No

This patch fixes the issue describe in bug report 1301.

https://sourceforge.net/p/swig/bugs/1301/#md_ex_pre

The patch is against the source code in swig-2.0.10:

$ diff -du Lib/python/builtin.swg.orig Lib/python/builtin.swg
--- Lib/python/builtin.swg.orig 2013-06-25 09:59:25.496368000 -0400
+++ Lib/python/builtin.swg      2013-06-25 10:03:11.187489000 -0400
@@ -13,7 +13,11 @@
        PyObject *o = wrapper(a, NULL);         \
        Py_XDECREF(o);                          \
     }                                          \
-    PyObject_Del(a);                           \
+    if (PyType_IS_GC(a->ob_type))              \
+       PyObject_GC_Del(a);                     \
+    } else {                                   \
+       PyObject_Del(a);                        \
+    }                                          \
 }

#define SWIGPY_INQUIRY_CLOSURE(wrapper) \

Discussion

  • I fixed a typo in the original patch (there too many underscore characters in PyObject_GC_Del(a))

     
  • William Fulton
    William Fulton
    2013-07-01

    • status: open --> closed
     
  • William Fulton
    William Fulton
    2013-07-01

    Thanks, I've applied this patch for swig-2.0.11.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks