[issue17922] Crash in clear_weakref

Amaury Forgeot d'Arc report at bugs.python.org
Tue May 7 17:54:16 CEST 2013


Amaury Forgeot d'Arc added the comment:

Python remembers SWIG types because SWIG generates code like this:

PyTypeObject * SwigPyObject_TypeOnce(void) {
  static PyTypeObject swigpyobject_type;
  static int type_init = 0;
  if (!type_init) {
    // ... initialization code ...
    swigpyobject_type = tmp;
    type_init = 1;
    if (PyType_Ready(&swigpyobject_type) < 0)
      return NULL;
  }
}

SWIG should reset "type_init" on a fresh interpreter.
The initXxx() function should do this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17922>
_______________________________________


More information about the Python-bugs-list mailing list