From: Joseph W. <jos...@ma...> - 2005-11-08 00:26:09
|
On 11/7/2005 5:07 AM, "Marcelo Matus" <mm...@ac...> wrote: > Better yet, submit the bug and a send us a patch :). > > Yes, swig never unload the modules, probably because nobody asked > for that before. So, if you, or somebody else, know how to unload modules, > please send us a patch. > > I guess, it could be important for debugging porpuses, as you are doing. > We usually use valgrind and mainly ignores all the messages comming > from the 'unloading' part. > > Marcelo Looks like an Py_INCREF was missing (sorry for the wrapping below) Index: Lib/python/pyrun.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v retrieving revision 1.81 diff -c -c -r1.81 pyrun.swg *** Lib/python/pyrun.swg 7 Nov 2005 12:40:16 -0000 1.81 --- Lib/python/pyrun.swg 8 Nov 2005 00:17:49 -0000 *************** *** 728,733 **** --- 728,734 ---- PyTuple_SetItem(data->newargs, 0, obj); } if (data->klass) { + Py_INCREF(data->klass); static PyObject* SWIG_STATIC_POINTER(destroystr) = PyString_FromString("__destroy__"); data->destroy = PyObject_GetAttr(data->klass, destroystr); if (PyErr_Occurred()) { > Joseph Winston wrote: > >> Synopsis: Unloading a module always fails with a visit_decref assertion. >> >> Information: >> System: Linux gt5012 2.6.12-9-686-smp #1 SMP Mon Oct 10 13:36:57 BST 2005 >> i686 GNU/Linux >> Compiler: gcc 4.0.2 >> python: 2.4.2 compiled -with --pydebug >> example: swig's Examples/python/class >> >> Using swig 1.3.24 >> $ python -c "import example" >> [7484 refs] >> >> Using the cvs version of swig (as of 18:30 CST on Nov 5, 2005): >> $ python -c "import example" >> python: Modules/gcmodule.c:275: visit_decref: Assertion `gc->gc.gc_refs != >> 0' failed. >> Aborted >> >> If needed, I can report this to the bug reporting system. >> >> Jody >> >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: >> Tame your development challenges with Apache's Geronimo App Server. Download >> it for free - -and be entered to win a 42" plasma tv or your very own >> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php >> _______________________________________________ >> Swig-devel mailing list >> Swi...@li... >> https://lists.sourceforge.net/lists/listinfo/swig-devel >> >> > |