summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-10-23 10:07:09 (GMT)
committervincentdarley <vincentdarley>2003-10-23 10:07:09 (GMT)
commit06f7470662af25ea53cefea3f2e731cbf6ce2eaf (patch)
treefb164689706be091d7b284d1badda12f413e55b6 /mac
parent3d2bf93ebfb3da81215e1ec381ba9cab00535ba3 (diff)
downloadtcl-06f7470662af25ea53cefea3f2e731cbf6ce2eaf.zip
tcl-06f7470662af25ea53cefea3f2e731cbf6ce2eaf.tar.gz
tcl-06f7470662af25ea53cefea3f2e731cbf6ce2eaf.tar.bz2
mac resource freeing fix
Diffstat (limited to 'mac')
-rw-r--r--mac/tclMacResource.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mac/tclMacResource.c b/mac/tclMacResource.c
index 2403ebf..aff6bed 100644
--- a/mac/tclMacResource.c
+++ b/mac/tclMacResource.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacResource.c,v 1.18 2003/10/14 15:44:53 dgp Exp $
+ * RCS: @(#) $Id: tclMacResource.c,v 1.19 2003/10/23 10:07:09 vincentdarley Exp $
*/
#include <Errors.h>
@@ -478,7 +478,14 @@ resourceRef? resourceType");
} else {
objPtr = Tcl_NewIntObj(id);
}
- ReleaseResource(resource);
+ /*
+ * If the Master Pointer of the returned handle is
+ * null, then resource was not in memory, and it is
+ * safe to release it. Otherwise, it is not.
+ */
+ if (*resource == NULL) {
+ ReleaseResource(resource);
+ }
result = Tcl_ListObjAppendElement(interp, resultPtr,
objPtr);
if (result != TCL_OK) {