Possible implementation:
we have a SignalsManager. When you need to intercept a signal you register yourself to the SignalManager. That way, it can keep track of who needs what.
When you receive your signal (either directly or via the signal manager, I think the second one is cleaner), once you've done your business, you tell the SM that you're done. He is a smart guy and can count, therefore he can remove old elements and there no need for garbage collectors.
Am I missing something?
Possible implementation:
we have a SignalsManager. When you need to intercept a signal you register yourself to the SignalManager. That way, it can keep track of who needs what.
When you receive your signal (either directly or via the signal manager, I think the second one is cleaner), once you've done your business, you tell the SM that you're done. He is a smart guy and can count, therefore he can remove old elements and there no need for garbage collectors.
Am I missing something?