From 9d8ccde662c66049b933f09e34b100628e02b769 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Tue, 2 Apr 2024 09:00:22 +1000 Subject: 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 --- jim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jim.c b/jim.c index ec855a2..fba53ac 100644 --- a/jim.c +++ b/jim.c @@ -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 -- cgit v1.1