UISpecificationTool.st
changeset 428 f87cca33874e
parent 367 5a78ebab56ff
child 536 3991e37ec19f
--- a/UISpecificationTool.st	Sun Jan 18 18:51:12 1998 +0100
+++ b/UISpecificationTool.st	Mon Jan 19 09:24:19 1998 +0100
@@ -401,7 +401,12 @@
 specification:aSpec
     "sets current edit specification
     "
+    self releaseResources.
+
     aSpec isNil ifTrue:[
+        specChannel notNil ifTrue:[ specChannel release ].
+        aspects     notNil ifTrue:[ aspects     release ].
+
         specChannel   := nil.
         specification := nil.
         aspects       := nil.
@@ -410,6 +415,9 @@
             specification := aSpec.
           ^ specChannel value:specification.
         ].
+        specChannel notNil ifTrue:[ specChannel release ].
+        aspects     notNil ifTrue:[ aspects     release ].
+
         specification  := aSpec.
         aspects        := IdentityDictionary new.
         specChannel    := specification asValue.
@@ -477,6 +485,19 @@
     ].
     ^ super aspectFor:aKey
 
+!
+
+releaseResources
+    "release resources
+    "
+    |frame appl|
+
+    frame := builder componentAt:#Frame.
+    appl  := builder application.
+    builder := UIBuilder new.
+    builder application:appl.
+    builder componentAt:#Frame put:frame.
+
 ! !
 
 !UISpecificationTool methodsFor:'change & update'!
@@ -516,10 +537,11 @@
 
         idx ~~ 0 ifTrue:[
             spec := specification class perform:((slices at:idx) last).
-        ].
+        ]
     ].
 
     spec ~= selection ifTrue:[
+        self releaseResources.
         frame := builder componentAt:#Frame.
         frame destroySubViews.