#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Tue, 05 Jul 2016 18:13:42 +0200
changeset 3919 2ba8a72b1c20
parent 3918 401939e91ddb
child 3922 01000fd41ee2
child 3923 a95e385a017f
#BUGFIX by stefan class: InstrumentationContext changed: #forProcess: do not keep references to dead processes (allow them to be garbage collected)
InstrumentationContext.st
--- a/InstrumentationContext.st	Thu Jun 30 20:12:04 2016 +0200
+++ b/InstrumentationContext.st	Tue Jul 05 18:13:42 2016 +0200
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libcomp' }"
 
+"{ NameSpace: Smalltalk }"
+
 Object variableSubclass:#InstrumentationContext
 	instanceVariableNames:'inInstrumentedCode enabled coverageOnly'
 	classVariableNames:'LastProcess LastInstrumentationContext
@@ -83,6 +85,14 @@
 
     |p context|
 
+    aProcess isDead ifTrue:[
+        "do not keep dead processes from being garbage collected"
+        aProcess == LastProcess ifTrue:[
+            LastProcess := LastInstrumentationContext := nil.
+        ].
+        ^ GlobalInstrumentationContext.
+    ].
+
     aProcess == LastProcess ifTrue:[
         ^ LastInstrumentationContext ? GlobalInstrumentationContext
     ].
@@ -326,10 +336,10 @@
 !InstrumentationContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationContext.st,v 1.15 2014-12-23 12:42:46 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationContext.st,v 1.15 2014-12-23 12:42:46 cg Exp $'
+    ^ '$Header$'
 ! !