diff options
author | welch <welch> | 1998-06-27 18:09:53 (GMT) |
---|---|---|
committer | welch <welch> | 1998-06-27 18:09:53 (GMT) |
commit | e49b28cf440752d763d488c4673d081883e93033 (patch) | |
tree | 1215c0959e90294b37bd360985895f49e8cbea9f /mac/tclMacAlloc.c | |
parent | 32e60ee1bab18f9b5441eeb97eadcf604af608ef (diff) | |
download | tcl-e49b28cf440752d763d488c4673d081883e93033.zip tcl-e49b28cf440752d763d488c4673d081883e93033.tar.gz tcl-e49b28cf440752d763d488c4673d081883e93033.tar.bz2 |
plugin updates
Diffstat (limited to 'mac/tclMacAlloc.c')
-rw-r--r-- | mac/tclMacAlloc.c | 14 |
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); } } |