Browse Source

reorder messages

David Rose 23 years ago
parent
commit
d1496169b8
1 changed files with 7 additions and 1 deletions
  1. 7 1
      direct/src/distributed/DistributedObject.py

+ 7 - 1
direct/src/distributed/DistributedObject.py

@@ -109,8 +109,14 @@ class DistributedObject(PandaObject):
         """disableAndAnnounce(self)
         """disableAndAnnounce(self)
         Inheritors should *not* redefine this function.
         Inheritors should *not* redefine this function.
         """
         """
-        self.disable()
+        # We must send the disable announce message *before* we
+        # actually disable the object.  That way, the various cleanup
+        # tasks can run first and take care of restoring the object to
+        # a normal, nondisabled state; and *then* the disable function
+        # can properly disable it (for instance, by parenting it to
+        # hidden).
         messenger.send(self.uniqueName("disable"))
         messenger.send(self.uniqueName("disable"))
+        self.disable()
         return None
         return None
 
 
     def announceGenerate(self):
     def announceGenerate(self):