avoid caching a debugger which got destroyed
authorClaus Gittinger <cg@exept.de>
Thu, 31 Jul 1997 21:21:36 +0200
changeset 1265 3db375412f5d
parent 1264 6d8f690883f1
child 1266 ee97c01c22c9
avoid caching a debugger which got destroyed (for example: from launchers destroy-view menu)
DebugView.st
--- a/DebugView.st	Thu Jul 31 18:55:15 1997 +0200
+++ b/DebugView.st	Thu Jul 31 21:21:36 1997 +0200
@@ -20,7 +20,7 @@
 		nChainShown inspectedProcess updateProcess stopButton
 		updateButton monitorToggle stepping steppedContextLineno
 		stepForReturn actualContext inWrap stackInspector steppedContext
-		wrapperContext verboseBacktrace firstContext stepHow'
+		wrapperContext verboseBacktrace firstContext stepHow cachable'
 	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
 		DebuggingDebugger VerboseBacktraceDefault DefaultIcon
 		InitialNCHAINShown'
@@ -243,7 +243,7 @@
     ].
     ^ debugger
 
-    "Modified: 14.4.1997 / 18:18:30 / cg"
+    "Modified: 31.7.1997 / 21:20:27 / cg"
 !
 
 newExclusive
@@ -524,7 +524,7 @@
 
     verboseBacktrace := VerboseBacktraceDefault ? false.
 
-    busy := true.
+    busy := cachable := true.
     inspecting := false.
     inspectedProcess := Processor activeProcess.
     stepping := false.
@@ -938,8 +938,8 @@
     ]
 
     "Created: 24.11.1995 / 19:52:54 / cg"
-    "Modified: 27.3.1997 / 18:28:43 / cg"
     "Modified: 17.4.1997 / 13:01:32 / stefan"
+    "Modified: 31.7.1997 / 21:18:38 / cg"
 !
 
 openOn:aProcess
@@ -2892,7 +2892,7 @@
     "caching the last debugger will make the next debugger appear
      faster, since no resources have to be allocated in the display.
      We have to be careful to release all refs to the debuggee, though.
-     Otherwise, the GC will not be able to release it"
+     Otherwise, the GC will not be able to release it."
 
     windowGroup notNil ifTrue:[
         windowGroup setProcess:nil.
@@ -2900,6 +2900,8 @@
 
     self releaseDebuggee.
 
+    cachable ~~ true ifTrue:[^ self].
+
     "/
     "/ only cache if I am on the Display
     "/
@@ -2911,8 +2913,8 @@
         ].
     ]
 
-    "Modified: 15.2.1997 / 18:53:48 / cg"
     "Modified: 10.7.1997 / 15:50:46 / stefan"
+    "Modified: 31.7.1997 / 21:20:14 / cg"
 !
 
 isCached
@@ -2959,14 +2961,24 @@
 uncacheMyself
     "do not remember myself any longer for next debug session"
 
+    |idx|
+
+    cachable := false.
+
     CachedExclusive == self ifTrue:[
         CachedExclusive := nil.
     ].
     CachedDebugger == self ifTrue:[
         CachedDebugger := nil.
     ].
-
-    "Created: 10.7.1997 / 14:25:23 / stefan"
+    OpenDebuggers notNil ifTrue:[
+        idx := OpenDebuggers identityIndexOf:self.
+        idx ~~ 0 ifTrue:[
+            OpenDebuggers at:idx put:nil
+        ].
+    ].
+
+    "Modified: 31.7.1997 / 21:20:11 / cg"
 ! !
 
 !DebugView methodsFor:'private control loop'!
@@ -3521,6 +3533,6 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.164 1997-07-31 15:07:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.165 1997-07-31 19:21:36 cg Exp $'
 ! !
 DebugView initialize!