G
Guy
Hi All,
I'm using the following architecture:
I have a singleton class (lets call it Manager class) that creates and holds
a reference to a BlockingQueue and a listener to that queue.
The class sends the listener to listen to the queue in another thread to
prevent the processing of the queue data to affect the main Thread
execution.
All the methods of the Manager class are static.
The Manager class implements the IDisposable interface.
The problem is that once the process is going down the Manager is not
disposed so the queue the listener and the Manager stay stuck in the
memory.
The only solution I could find is to call the Manager Dispose method from
another class's Dispose().
Does anyone know how can I avoid this 'Spaghetti' coding and make the
Manager class manage its own disposing?
Guy
I'm using the following architecture:
I have a singleton class (lets call it Manager class) that creates and holds
a reference to a BlockingQueue and a listener to that queue.
The class sends the listener to listen to the queue in another thread to
prevent the processing of the queue data to affect the main Thread
execution.
All the methods of the Manager class are static.
The Manager class implements the IDisposable interface.
The problem is that once the process is going down the Manager is not
disposed so the queue the listener and the Manager stay stuck in the
memory.
The only solution I could find is to call the Manager Dispose method from
another class's Dispose().
Does anyone know how can I avoid this 'Spaghetti' coding and make the
Manager class manage its own disposing?
Guy