I wonder how this survived so long in Blender... (2005/03/09 commit).
Reason was the call to BPY_free_screen_spacehandlers(sc) in kernel,
which was freeing up scripthandlers in a weird way. That call is
really obsolete. The real freeing should go in the del_area() call,
to prevent copying and deleting area in the UI to go wrong.
(Crash happened in testing timeline markers, and holding CTRL+Uparrow
a while...)
void BPY_do_pyscript (struct ID *id, short int event);
void BPY_clear_script (struct Script *script);
void BPY_free_compiled_text (struct Text *text);
-void BPY_free_screen_spacehandlers (struct bScreen *sc);
/* pydrivers */
struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver);
float BPY_pydriver_eval(struct IpoDriver *driver);
void BPY_do_pyscript(ID *id, short int event){}
void BPY_clear_script(Script *script){}
void BPY_free_compiled_text(struct Text *text){}
-void BPY_free_screen_spacehandlers (struct bScreen *sc){}
void BPY_pydriver_update(void){}
float BPY_pydriver_eval(struct IpoDriver *driver)
{
{
unlink_screen(sc);
- BPY_free_screen_spacehandlers(sc);
BLI_freelistN(&sc->vertbase);
BLI_freelistN(&sc->edgebase);
BLI_freelistN(&sc->areabase);
void BPY_Err_Handle( char *script_name );
PyObject *traceback_getFilename( PyObject * tb );
-void BPY_free_screen_spacehandlers(struct bScreen *sc);
-
/****************************************************************************
* Description: This function will start the interpreter and load all modules
* as well as search for a python installation.
void BPY_free_scriptlink( struct ScriptLink *slink )
{
if( slink->totscript ) {
- if( slink->flag )
+ if( slink->flag ) {
MEM_freeN( slink->flag );
- if( slink->scripts )
+ slink->flag= NULL;
+ }
+ if( slink->scripts ) {
MEM_freeN( slink->scripts );
+ slink->scripts= NULL;
+ }
}
return;
}
-void BPY_free_screen_spacehandlers(struct bScreen *sc)
-{
- ScrArea *sa;
-
- for (sa = sc->areabase.first; sa; sa = sa->next)
- BPY_free_scriptlink(&sa->scriptlink);
-}
-
static int CheckAllSpaceHandlers(Text *text)
{
bScreen *screen;
uiFreeBlocks(&sa->uiblocks);
uiFreePanels(&sa->panels);
- if(sa==curarea) curarea= 0;
- if(sa==g_activearea) g_activearea= 0;
+ BPY_free_scriptlink(&sa->scriptlink);
+
+ if(sa==curarea) curarea= NULL;
+ if(sa==g_activearea) g_activearea= NULL;
}
/* sa2 to sa1 */