changes to allow effective subclassing by CachingRegistry
authorClaus Gittinger <cg@exept.de>
Fri, 23 Jul 1999 01:19:29 +0200
changeset 4435 6461ba759d1b
parent 4434 887b60637a1c
child 4436 318297e533a6
changes to allow effective subclassing by CachingRegistry
Registry.st
--- a/Registry.st	Fri Jul 23 01:17:43 1999 +0200
+++ b/Registry.st	Fri Jul 23 01:19:29 1999 +0200
@@ -248,6 +248,15 @@
 
     "Created: 16.1.1997 / 18:08:00 / cg"
     "Modified: 6.3.1997 / 22:29:58 / cg"
+!
+
+unregister:anObject atIndex:index
+    "strictly private"
+
+    handleArray at:index put:nil.
+    registeredObjects at:index put:nil.
+    indexTable removeKey:anObject.
+    tally := tally - 1.
 ! !
 
 !Registry methodsFor:'registering objects'!
@@ -418,12 +427,9 @@
     registeredObjects notNil ifTrue:[
         wasBlocked := OperatingSystem blockInterrupts.
         "/ index := registeredObjects identityIndexOf:anObject ifAbsent:0.
-	index := indexTable at:anObject ifAbsent:0.
+        index := indexTable at:anObject ifAbsent:0.
         index ~~ 0 ifTrue:[
-            handleArray at:index put:nil.
-            registeredObjects at:index put:nil.
-	    indexTable removeKey:anObject.
-            tally := tally - 1.
+            self unregister:anObject atIndex:index.
         ].
         wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 
@@ -450,10 +456,7 @@
             obj := registeredObjects at:index.
             (obj notNil and:[obj ~~ 0]) ifTrue:[
                 (aBlock value:obj) ifTrue:[
-                    handleArray at:index put:nil.
-                    registeredObjects at:index put:nil.
-	            indexTable removeKey:obj.
-                    tally := tally - 1.
+                    self unregister:obj atIndex:index.
                 ]
             ]
         ].
@@ -468,5 +471,5 @@
 !Registry class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Registry.st,v 1.52 1999-06-02 16:23:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Registry.st,v 1.53 1999-07-22 23:19:29 cg Exp $'
 ! !