From 41911da25880f01a9bd8a0ae05ca480cede8b1cb Mon Sep 17 00:00:00 2001 From: Stephen Swaney Date: Mon, 5 Feb 2007 05:09:15 +0000 Subject: [PATCH] Bugfix #5918 GE Crash when press Esc Modifier.c had ref count problems from TypeDict being added twice to module. Congratulations due to Tom Musgrove (LetterRip) for chasing this down. --- source/blender/python/api2_2x/Modifier.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/python/api2_2x/Modifier.c b/source/blender/python/api2_2x/Modifier.c index 4ed245fa1cf..34e36d2a6e6 100644 --- a/source/blender/python/api2_2x/Modifier.c +++ b/source/blender/python/api2_2x/Modifier.c @@ -1429,6 +1429,9 @@ PyObject *Modifier_Init( void ) if( TypeDict ) { PyModule_AddObject( submodule, "Type", TypeDict ); /* deprecated */ + /* since PyModule_AddObject() steals a reference, we need to + incref TypeDict to use it again */ + Py_INCREF( TypeDict); PyModule_AddObject( submodule, "Types", TypeDict ); }