[Python-Dev] GC and ExtensionClass (original) (raw)
Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Mon, 14 May 2001 21:40:21 +0200
- Previous message: [Python-Dev] GC and ExtensionClass
- Next message: [Python-Dev] GC and ExtensionClass
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Okay, so I'm completed confused now. I extended the definition of ECTypeType to include this after the doc string slot:
(traverseproc)0, /* tptraverse */ (inquiry)0, /* tpclear */ (richcmpfunc)0, /* rich comparisons */ 0L, /* weak reference enabler */ #ifdef COUNTALLOCS /* these must be last */ 0, /* tpalloc */ 0, /* tpfree */ 0, /* tpmaxalloc */ (struct typeobject )0, / tpnext */ #endif
Why did you do that? ECTypeType has the right data type (PyTypeObject). It is the instances of PyExtensionClass that are troubling
When I looked at the definition of ECType, after the doc string I saw
METHODCHAIN(ExtensionClassmethods) as Martin indicated. I can't simply insert the same zeroes at the end of the ECType def'n as I did at the end of the ECTypeType definition.
Of course not. ECType is of type PyExtensionClass, not of type PyTypeObject. Those are similar, but not equal.
Where does this METHODCHAIN thing go? I looked at the def'n of struct typeobject in Include/object.h but didn't see a slot that looked suitable.
Just have a look at ExtensionClass.h instead.
FWIW, when I build Python and PyGtk with PyDEBUG defined as Neil suggested, I get
Fatal Python error: UNREF invalid object when I run my failing script. This is with and without making any changes to ECType or ECTypeType.
BTW, what version of PyGtk did you try to compile? I've tried the 0.7.0-dont-use, and it can run examples/testgtk without major problems (the example did need some updates, since it is apparently outdated). My Gtk version was 1.2, on Linux.
In any case, I think you need to analyse this in a debugger.
Regards, Martin
- Previous message: [Python-Dev] GC and ExtensionClass
- Next message: [Python-Dev] GC and ExtensionClass
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]