- duplicated script spaces would keep a pointer to the PyObject button list. (causing python errors with negative reference counts when freeing spaces)
- Exiting blender would crash when a UI was open because the ScriptSpaces button PyList was being free'd after python Py_Finalize was called.
This commit is contained in:
Campbell Barton 2008-06-11 14:31:51 +00:00
parent d0fc57e5df
commit 21a46a0155
2 changed files with 13 additions and 6 deletions

@ -1154,13 +1154,17 @@ static void unlink_script( Script * script )
if( sl->spacetype == SPACE_SCRIPT ) {
SpaceScript *sc = ( SpaceScript * ) sl;
if( sc->script == script ) {
if( sc->script == script ) {
sc->script = NULL;
if( sc ==
area->spacedata.first ) {
scrarea_queue_redraw
( area );
if( sc == area->spacedata.first ) {
scrarea_queue_redraw( area );
}
if (sc->but_refs) {
BPy_Set_DrawButtonsList(sc->but_refs);
BPy_Free_DrawButtonsList();
sc->but_refs = NULL;
}
}
}

@ -6334,7 +6334,10 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2)
SpaceNode *snode= (SpaceNode *)sl;
snode->nodetree= NULL;
}
else if(sl->spacetype==SPACE_SCRIPT) {
SpaceScript *sc = ( SpaceScript * ) sl;
sc->but_refs = NULL;
}
sl= sl->next;
}