aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2014-01-11 14:10:10 +1000
committerSteve Bennett <steveb@workware.net.au>2014-01-15 11:22:59 +1000
commitfd5d1d16f156d270989f7a79593bab18b19a995a (patch)
treecd0ed3029671b2d8fe7199eaab7d6a08af766205
parent3a4713a32daf2114beac05cabb58b19220c9b93f (diff)
downloadjimtcl-fd5d1d16f156d270989f7a79593bab18b19a995a.zip
jimtcl-fd5d1d16f156d270989f7a79593bab18b19a995a.tar.gz
jimtcl-fd5d1d16f156d270989f7a79593bab18b19a995a.tar.bz2
jim.c: only complain on unfreed objects if --maintainer
Probably only developers care about reference count mismatches at exit. Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/jim.c b/jim.c
index add0c3c..cd6e616 100644
--- a/jim.c
+++ b/jim.c
@@ -5476,11 +5476,13 @@ void Jim_FreeInterp(Jim_Interp *i)
/* Check that the live object list is empty, otherwise
* there is a memory leak. */
+#ifdef JIM_MAINTAINER
if (i->liveList != NULL) {
- objPtr = i->liveList;
-
printf(JIM_NL "-------------------------------------" JIM_NL);
printf("Objects still in the free list:" JIM_NL);
+
+ objPtr = i->liveList;
+
while (objPtr) {
const char *type = objPtr->typePtr ? objPtr->typePtr->name : "string";
@@ -5502,6 +5504,8 @@ void Jim_FreeInterp(Jim_Interp *i)
printf("-------------------------------------" JIM_NL JIM_NL);
JimPanic((1, "Live list non empty freeing the interpreter! Leak?"));
}
+#endif
+
/* Free all the freed objects. */
objPtr = i->freeList;
while (objPtr) {