summaryrefslogtreecommitdiffstats
path: root/mac/tclMacAlloc.c
diff options
context:
space:
mode:
authorwelch <welch@noemail.net>1998-06-27 18:09:53 (GMT)
committerwelch <welch@noemail.net>1998-06-27 18:09:53 (GMT)
commitbad23c30f183e85acf85ab5c18da435fbf5c8fc2 (patch)
tree1215c0959e90294b37bd360985895f49e8cbea9f /mac/tclMacAlloc.c
parentc95abd5e8369461af64d0bdd12781fd7edd702af (diff)
downloadtcl-bad23c30f183e85acf85ab5c18da435fbf5c8fc2.zip
tcl-bad23c30f183e85acf85ab5c18da435fbf5c8fc2.tar.gz
tcl-bad23c30f183e85acf85ab5c18da435fbf5c8fc2.tar.bz2
plugin updates
FossilOrigin-Name: 594ce53543ab0e1e09fe7eabec3e198a06256812
Diffstat (limited to 'mac/tclMacAlloc.c')
-rw-r--r--mac/tclMacAlloc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mac/tclMacAlloc.c b/mac/tclMacAlloc.c
index 59d1417..6736675 100644
--- a/mac/tclMacAlloc.c
+++ b/mac/tclMacAlloc.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
+
/*
* Flags that are used by ConfigureMemory to define how the allocator
* should work. They can be or'd together.
@@ -242,6 +243,7 @@ TclpSysFree(
hand = * (Handle *) ((Ptr) ptr - sizeof(Handle));
DisposeHandle(hand);
+ *hand = NULL;
err = MemError();
}
@@ -272,7 +274,9 @@ CleanUpExitProc()
while (systemMemory != NULL) {
memRecord = systemMemory;
systemMemory = memRecord->next;
- DisposeHandle(memRecord->memoryHandle);
+ if (*(memRecord->memoryHandle) != NULL) {
+ DisposeHandle(memRecord->memoryHandle);
+ }
DisposePtr((void *) memRecord);
}
}
@@ -303,13 +307,17 @@ FreeAllMemory()
while (systemMemory != NULL) {
memRecord = systemMemory;
systemMemory = memRecord->next;
- DisposeHandle(memRecord->memoryHandle);
+ if (*(memRecord->memoryHandle) != NULL) {
+ DisposeHandle(memRecord->memoryHandle);
+ }
DisposePtr((void *) memRecord);
}
while (appMemory != NULL) {
memRecord = appMemory;
appMemory = memRecord->next;
- DisposeHandle(memRecord->memoryHandle);
+ if (*(memRecord->memoryHandle) != NULL) {
+ DisposeHandle(memRecord->memoryHandle);
+ }
DisposePtr((void *) memRecord);
}
}