PhysicsManager, StateTracker and static references lifetime

Hi,

TrueSync uses many static references to common objects: TrueSyncManager, PhysicsManager, StateTracker.

Those references aren't cleaned up and they never become null. So, even if we change scene, the instances of these objects are still alive, until we create a new world.

Can we find a solution in order to clean up the objects when we change scene and avoid this massive leak?

Devis

Comments

  • Thanks @Devis, sure we will find one, there is a refactoring task to be done, but we decide to fix a few other things first, but what you mentioned it is an important one.
  • Ok @JeffersonHenrique. Actually we can easily use a workaround for TrueSyncManager and PhysicsManager, settings their static instance references to null before unloading the scene.

    But we can't do anything with StateTracker. I suppose that it takes a reference to each tracked object, and these references will never cleaned up, even if the objects are destroyed.

    Is there a way to force StateTracker to release all those references?
  • I got it @Devis, from the public API you could call "StateTracker.Init" that it will loose the old reference and create an empty instance. We will propose a better solution for this clean up soon. Thanks for mention this issue.
  • Ok @JeffersonHenrique. For now, we'll call Init() in order to release all its references. Thanks for the support.