DABC (Data Acquisition Backbone Core)
2.9.9
|
Object live may be complex but way to destroy it much more complex.
Problems are:
First, object is checked that if it is assigned with a thread (flHasThread). It means that object can be actively used in the thread and any cleanup should happen from this thread. In this case DestroyByOwnThread() method will be called. Method can return true only when objects allowed to be destroyed immediately
If object does not have thread, ObjectCleanup() will be called immediately, otherwise it will be called in thread context. Main motivation for ObjectCleanup() is to release references on all other objects which may be used inside. One also can free buffers, close files and do any other relevant job here.
At the end will be checked existing references on the object. If any exists, object will be moved to manager cleanup queue. Manager will try to check if reference can be cleared and finally delete object.
TODO: dabc::Object::Destroy() should not be used very often, rather reference on the object must be used Therefore one should try to avoid dabc::Object::Destroy() as much as possible