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 ); }