diff --git a/jim.c b/jim.c index 5257d02c..9e82a207 100644 --- a/jim.c +++ b/jim.c @@ -5825,6 +5825,9 @@ void Jim_FreeInterp(Jim_Interp *i) JimFreeCallFrame(i, cf, JIM_FCF_FULL); } + /* Must be done before freeing singletons */ + Jim_FreeHashTable(&i->commands); + Jim_DecrRefCount(i, i->emptyObj); Jim_DecrRefCount(i, i->trueObj); Jim_DecrRefCount(i, i->falseObj); @@ -5836,8 +5839,6 @@ void Jim_FreeInterp(Jim_Interp *i) Jim_DecrRefCount(i, i->nullScriptObj); Jim_DecrRefCount(i, i->currentFilenameObj); - Jim_FreeHashTable(&i->commands); - /* This will disard any cached commands */ Jim_InterpIncrProcEpoch(i);