when destroying or changing the client, release as subApp
authorClaus Gittinger <cg@exept.de>
Thu, 12 Aug 1999 19:16:49 +0200
changeset 1471 09a5803325e4
parent 1470 1e262f28a5a6
child 1472 fd1871a0d888
when destroying or changing the client, release as subApp
SubCanvas.st
--- a/SubCanvas.st	Tue Aug 10 11:02:30 1999 +0200
+++ b/SubCanvas.st	Thu Aug 12 19:16:49 1999 +0200
@@ -97,20 +97,25 @@
     "release existing components and generate new components from
      the given windowSpec, using the given builder."
 
+    |myApp|
+
     builder  := aBuilder.
     spec     := aWindowSpecOrSpecSymbol.
 
     "/ check for master application
     (anApplication notNil and:[anApplication masterApplication isNil]) ifTrue:[
-        client := nil.
-        client := self application.
-        client ~~ anApplication ifTrue:[
-            anApplication masterApplication:client
+        myApp := self application.
+        myApp ~~ anApplication ifTrue:[
+            anApplication masterApplication:myApp
         ]
     ].
+
+    (client notNil and:[client ~~ anApplication]) ifTrue:[
+        client releaseAsSubCanvas
+    ].
     client := anApplication.
     self rebuild.
-  ^ builder
+    ^ builder
 !
 
 makeClientViewScrollable:aBoolean
@@ -298,6 +303,10 @@
 !SubCanvas methodsFor:'initialization'!
 
 destroy
+    client notNil ifTrue:[
+        client releaseAsSubCanvas.
+    ].
+
     clientHolder notNil ifTrue:[
         clientHolder removeDependent:self.
         clientHolder := nil.
@@ -335,5 +344,5 @@
 !SubCanvas class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.15 1999-08-05 11:37:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.16 1999-08-12 17:16:49 cg Exp $'
 ! !