changes to help refcounts in rna be more predictable (still leaks when reloading on - F8)

This commit is contained in:
2009-08-15 09:53:38 +00:00
parent 12291b693c
commit 712b67743b
3 changed files with 61 additions and 13 deletions

View File

@@ -154,9 +154,15 @@ static void bpy_init_modules( void )
void BPY_update_modules( void )
{
#if 0 // slow, this runs all the time poll, draw etc 100's of time a sec.
PyObject *mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0);
PyModule_AddObject( mod, "data", BPY_rna_module() );
PyModule_AddObject( mod, "types", BPY_rna_types() );
PyModule_AddObject( mod, "types", BPY_rna_types() ); // atm this does not need updating
#endif
/* refreshes the main struct */
BPY_update_rna_module();
}
/*****************************************************************************
@@ -264,6 +270,8 @@ void BPY_start_python( int argc, char **argv )
PyDict_SetItemString(d, "__import__", item=PyCFunction_New(bpy_import_meth, NULL)); Py_DECREF(item);
}
pyrna_alloc_types();
py_tstate = PyGILState_GetThisThreadState();
PyEval_ReleaseThread(py_tstate);
}