Object.st
changeset 6461 f5efaff3457b
parent 6439 0f841258ec4a
child 6466 ae28dd895a58
--- a/Object.st	Mon Mar 11 11:08:00 2002 +0100
+++ b/Object.st	Mon Mar 11 11:49:22 2002 +0100
@@ -2756,17 +2756,6 @@
     ^ self slowShallowCopy
 !
 
-shallowCopyForFinalization
-    "OBSOLETE INTERFACE: use #executor.
-     This is used to aquire a copy to be used for finalization -
-     (the copy will get a dispose-notification; see the documentation in the Registry class)
-     This method can be redefined for more efficient copying - especially for large objects."
-
-    <resource: #obsolete>
-
-    ^ self shallowCopy
-!
-
 simpleDeepCopy
     "return a copy of the object with all subobjects also copied.
      This method does NOT handle cycles - but is included to allow this 
@@ -4044,6 +4033,14 @@
     ^ self shallowCopyForFinalization
 !
 
+finalizationLobby
+    "answer a Registry used for finalization.
+     Use a generic Registry for any object.
+     Subclasses using their own Registry should redefine this"
+
+    ^ FinalizationLobby
+!
+
 finalize
     "this is invoked for executor objects which have been registered
      in a Registry, when the original object dies.
@@ -4058,34 +4055,35 @@
 
 reRegisterForFinalization
     "re-register mySelf for later finalization.
-     This will create a new executor, which will receive a #disposed message when
+     This will create a new executor, which will receive a #finalize message when
      the receiver is garbage collected."
 
-    FinalizationLobby isNil ifTrue:[
-        FinalizationLobby := Registry new.
-    ].
-    FinalizationLobby registerChange:self
-
+    self finalizationLobby registerChange:self
 !
 
 registerForFinalization
     "register mySelf for later finalization.
-     Once registered, the executor of the receiver will receive a #disposed message when
+     Once registered, the executor of the receiver will receive a #finalize message when
      the receiver is garbage collected."
 
-    FinalizationLobby isNil ifTrue:[
-        FinalizationLobby := Registry new.
-    ].
-    FinalizationLobby register:self
-
+    self finalizationLobby register:self
+!
+
+shallowCopyForFinalization
+    "OBSOLETE INTERFACE: use #executor.
+     This is used to aquire a copy to be used for finalization -
+     (the copy will be sent a #finalize message; see the documentation in the Registry class)
+     This method can be redefined for more efficient copying - especially for large objects."
+
+    <resource: #obsolete>
+
+    ^ self shallowCopy
 !
 
 unregisterForFinalization
     "unregister mySelf from later finalization"
 
-    FinalizationLobby notNil ifTrue:[
-        FinalizationLobby unregister:self
-    ]
+    self finalizationLobby unregister:self
 ! !
 
 !Object methodsFor:'initialization'!
@@ -8662,6 +8660,6 @@
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.396 2002-03-04 14:19:59 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.397 2002-03-11 10:48:55 stefan Exp $'
 ! !
 Object initialize!