aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatthoyts <patthoyts>2005-03-05 22:06:51 +0000
committerpatthoyts <patthoyts>2005-03-05 22:06:51 +0000
commitb54a13021a55c4d608999ac8d02d9c6714746f5e (patch)
treea0374c03c2eae90cf3995c500ff8b40e54dd6ee8
parent14f723c4d8e7eeeb8fee0f7df7666440d50b9203 (diff)
downloadjimtcl-b54a13021a55c4d608999ac8d02d9c6714746f5e.zip
jimtcl-b54a13021a55c4d608999ac8d02d9c6714746f5e.tar.gz
jimtcl-b54a13021a55c4d608999ac8d02d9c6714746f5e.tar.bz2
Free an objects internal representation before freeing the string rep.
-rw-r--r--jim.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/jim.c b/jim.c
index 8cad1d5..ed901db 100644
--- a/jim.c
+++ b/jim.c
@@ -1,7 +1,7 @@
/* Jim - A small embeddable Tcl interpreter
* Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
*
- * $Id: jim.c,v 1.66 2005/03/05 15:04:13 antirez Exp $
+ * $Id: jim.c,v 1.67 2005/03/05 22:06:51 patthoyts Exp $
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1663,13 +1663,13 @@ void Jim_FreeObj(Jim_Interp *interp, Jim_Obj *objPtr)
if (objPtr->refCount == -1) {
Jim_Panic("Object %p double freed!", objPtr);
}
+ /* Free the internal representation */
+ Jim_FreeIntRep(interp, objPtr);
/* Free the string representation */
if (objPtr->bytes != NULL) {
if (objPtr->bytes != JimEmptyStringRep)
Jim_Free(objPtr->bytes);
}
- /* Free the internal representation */
- Jim_FreeIntRep(interp, objPtr);
/* Unlink the object from the live objects list */
if (objPtr->prevObjPtr)
objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;