#OTHER by stefan
authorStefan Vogel <sv@exept.de>
Tue, 13 Sep 2016 17:40:36 +0200
changeset 7564 5330f64092a5
parent 7563 3555a447b0aa
child 7565 462e6f62c737
#OTHER by stefan class: DeviceWorkstation changed: #checkForEndOfDispatch #releaseDeviceResources release resources at end of dispatch
DeviceWorkstation.st
--- a/DeviceWorkstation.st	Tue Sep 13 15:06:59 2016 +0200
+++ b/DeviceWorkstation.st	Tue Sep 13 17:40:36 2016 +0200
@@ -4734,27 +4734,24 @@
     dispatching ifFalse:[^ self].
 
     self == Display ifTrue:[
-	ExitOnLastClose == true ifFalse:[^ self].
+        ExitOnLastClose == true ifFalse:[^ self].
     ].
     exitOnLastClose == true ifFalse:[^ self].
 
     knownViews notNil ifTrue:[
-	"/ if there is no non-popup topview, stop dispatching
-	(knownViews contains:[:slot |
-		slot notNil
-		and:[(self viewIsRelevantInCheckForEndOfDispatch:slot)
-		and:[true "slot isModal not"
-		"and:[slot realized]"]]]
-	 ) ifFalse:[
-	    "/ my last view was closed
-	    dispatching := false.
-	    Logger info:'finished dispatch (last view closed): %1' with:self.
-	    LastActiveScreen == self ifTrue:[
-		LastActiveScreen := nil.
-		LastActiveProcess := nil.
-	    ].
-	    eventSema notNil ifTrue:[eventSema signal].  "/ get dispatchLoop out of its wait...
-	]
+        "/ if there is no non-popup topview, stop dispatching
+        (knownViews contains:[:slot |
+                slot notNil
+                and:[(self viewIsRelevantInCheckForEndOfDispatch:slot)
+                and:[true "slot isModal not"
+                "and:[slot realized]"]]]
+         ) ifFalse:[
+            "/ my last view was closed
+            dispatching := false.
+            Logger info:'finished dispatch (last view closed): %1' with:self.
+            self releaseDeviceResources.
+            eventSema notNil ifTrue:[eventSema signal].  "/ get dispatchLoop out of its wait...
+        ]
     ].
 
     "Modified: 19.9.1995 / 11:31:54 / claus"
@@ -6288,22 +6285,25 @@
      (i.e. be prepared to not be able to release resources regularily)"
 
     LastActiveScreen == self ifTrue:[
-	LastActiveScreen := nil.
-	LastActiveProcess := nil.
+        LastActiveScreen := nil.
+        LastActiveProcess := nil.
     ].
 
     Image releaseResourcesOnDevice:self.
+    Icon notNil ifTrue:[
+        Icon releaseCachedIconsFromDevice:self.
+    ].
 
     "This unregisters all the finalization handles"
     self releaseGraphicsContexts.
 
     blackColor notNil ifTrue:[
-	blackColor releaseFromDevice.
-	blackColor := nil.
+        blackColor releaseFromDevice.
+        blackColor := nil.
     ].
     whiteColor notNil ifTrue:[
-	whiteColor releaseFromDevice.
-	whiteColor := nil.
+        whiteColor releaseFromDevice.
+        whiteColor := nil.
     ].
     self releaseDeviceColors.
     self releaseDeviceCursors.