From 0058eea3ad8f0967f6697b502a47b17a536fa7c2 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 1 Jul 2013 19:23:10 +0100 Subject: [PATCH] Add SF patch #342 fix some director classes crashing on object deletion when using -builtin. Fixes SF bug #1301 and python test cases director_basic and director_classic seg faulting when used with -builtin. Patch from Christian Delbaere. --- CHANGES.current | 4 ++++ Lib/python/builtin.swg | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.current b/CHANGES.current index 023f2ef6c..27ea24688 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release. Version 2.0.11 (in progress) ============================ +2013-08-01: wsfulton + [Python] Add SF patch #342 from Christian Delbaere to fix some director classes crashing on + object deletion when using -builtin. Fixes SF bug #1301. + 2013-07-11: wsfulton [Python] Add SWIG_PYTHON_INTERPRETER_NO_DEBUG macro which can be defined to use the Release version of the Python interpreter in Debug builds of the wrappers. The Visual Studio .dsp example diff --git a/Lib/python/builtin.swg b/Lib/python/builtin.swg index 1fc3fb05f..28c557a21 100644 --- a/Lib/python/builtin.swg +++ b/Lib/python/builtin.swg @@ -13,7 +13,11 @@ wrapper##_closure(PyObject *a) { \ 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) \