|
@@ -3429,7 +3429,7 @@ tnsObject *tnsCreateRootObject(char *name){
|
|
|
strSafeSet(&o->Name, name);
|
|
|
lstAppendItem(&w->RootObjects, o);
|
|
|
|
|
|
- w->ActiveRoot = o; // XXX: same here
|
|
|
+ memAssignRef(w,&w->ActiveRoot,o);
|
|
|
|
|
|
o->Drivers=memAcquire(sizeof(laRackPageCollection));
|
|
|
|
|
@@ -3440,13 +3440,19 @@ void tnsDestroyRootObject(tnsObject *root){
|
|
|
tnsObject *o, *NextO;
|
|
|
memAssignRef(w,&w->ActiveRoot,root->Item.pPrev ? root->Item.pPrev : root->Item.pNext ? root->Item.pNext : 0);
|
|
|
|
|
|
+ root->Evaluated.Done=root->EvaluatedPlay.Done=0;
|
|
|
tnsFreeEvaluatedArray(&root->Evaluated);
|
|
|
- tnsClearPlayDuplicate(o);
|
|
|
- if(o->EvaluatedPlay.Commands) tnsFreeEvaluatedArray(&o->EvaluatedPlay);
|
|
|
- tnsFreeEvaluatedScene(&o->EvaluatedPlay);
|
|
|
+ tnsClearPlayDuplicate(root);
|
|
|
+ if(root->EvaluatedPlay.Commands) tnsFreeEvaluatedArray(&root->EvaluatedPlay);
|
|
|
+ tnsFreeEvaluatedScene(&root->EvaluatedPlay);
|
|
|
|
|
|
- //XXX: destroy rack page; and then release memory;
|
|
|
- root->Drivers=0; memLeave(root->Drivers);
|
|
|
+ //destroy rack page; and then release memory;
|
|
|
+ laRackPage*rp;
|
|
|
+ while(rp=lstPopItem(&root->Drivers->Pages)){
|
|
|
+ laNodeRack* rr; while(rr=lstPopItem(&rp->Racks)){ laDestroyRack(rr); }
|
|
|
+ memLeave(rp);
|
|
|
+ }
|
|
|
+ memLeave(root->Drivers); // root->Drivers=0; never reset address for single, see la_GiveDiffCommand()
|
|
|
|
|
|
lstRemoveItem(&w->RootObjects, root);
|
|
|
while (lstPopPointerLeave(&root->ChildObjects));
|