diff options
author | Steve Bennett <steveb@workware.net.au> | 2024-04-02 09:00:22 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2024-04-02 09:02:37 +1000 |
commit | 9d8ccde662c66049b933f09e34b100628e02b769 (patch) | |
tree | c3b8bd9270d14dafc9fe9f654c12c068c5e7058b | |
parent | 4b980e667b2a07f5ea3aeb437079db9be6f89979 (diff) | |
download | jimtcl-9d8ccde662c66049b933f09e34b100628e02b769.zip jimtcl-9d8ccde662c66049b933f09e34b100628e02b769.tar.gz jimtcl-9d8ccde662c66049b933f09e34b100628e02b769.tar.bz2 |
fix a memory leak on interp shutdown
Need to delete the commands hash table before calling
Jim_InterpIncrProcEpoch() as otherwise the commands
won't yet be in the "old command" list to be deleted.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -5820,10 +5820,11 @@ 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); - Jim_FreeHashTable(&i->commands); #ifdef JIM_REFERENCES Jim_FreeHashTable(&i->references); #endif |