- fixed problems deallocation sicsobjects

This commit is contained in:
zolliker
2009-02-25 14:50:00 +00:00
parent 1914d04420
commit 4b82f13ab1
7 changed files with 47 additions and 48 deletions

View File

@ -450,12 +450,11 @@ void DeleteInterp(SicsInterp * self)
if (tail) {
pCurrent = tail;
while (pCurrent) {
/* the line below fixes problems with kill functions
* traversing the command list
*/
pCurrent->pNext = NULL;
pCurrent->pNext = NULL; /* inhibit access to killed commands by FindCommandData */
if (pCurrent->KFunc) {
pCurrent->KFunc(pCurrent->pData);
void *data = pCurrent->pData;
pCurrent->pData = NULL; /* make data unreachable by FindCommandData before killing */
pCurrent->KFunc(data);
}
if (pCurrent->pName) {
/* printf("Deleting %s\n",pCurrent->pName); */