From ba919b0948cefca030ce19933bfec34fe2db063b Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 11 Jun 2016 01:11:03 +0200 Subject: [PATCH] Fix crash running TaskTester --- dtool/src/interrogate/interfaceMaker.cxx | 3 ++- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index 03398895b8..472db3d9ce 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -145,7 +145,8 @@ check_protocols() { if (func->_ifunc.get_name() == "__traverse__") { // If we have a method named __traverse__, we implement Python's // cyclic garbage collection protocol. - _protocol_types |= PT_python_gc; + //XXX disabled for now because it's too unstable. + //_protocol_types |= PT_python_gc; } } diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index a1fec26630..1091132312 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -2730,10 +2730,9 @@ write_module_class(ostream &out, Object *obj) { } string gcflag; - // Disabled for now because it's too unstable. - /*if (obj->_protocol_types & Object::PT_python_gc) { + if (obj->_protocol_types & Object::PT_python_gc) { gcflag = " | Py_TPFLAGS_HAVE_GC"; - }*/ + } // long tp_flags; if (has_local_getbuffer) { @@ -2759,10 +2758,12 @@ write_module_class(ostream &out, Object *obj) { } // traverseproc tp_traverse; - write_function_slot(out, 4, slots, "tp_traverse"); + out << " 0, // tp_traverse\n"; + //write_function_slot(out, 4, slots, "tp_traverse"); // inquiry tp_clear; - write_function_slot(out, 4, slots, "tp_clear"); + out << " 0, // tp_clear\n"; + //write_function_slot(out, 4, slots, "tp_clear"); // richcmpfunc tp_richcompare; if (has_local_richcompare) {