Detecting lost callbacks in runtime

I’m pondering how I might safeguard my code against the risk of a lost callback.

I’m generally happy with the structure that I have, but there is always a chance that I might overlook something and end up with a state where a callback is lost (ie function returns without invoking the callback and without tying it to some certain future event).

Is there a tried and true method for using weak references to detect that a callback that, while still expected to be invoked at some future time, has been dropped from memory altogether?

I’m not expecting the method to allow me to recover, but it could at least alert me to a flaw.

I tried googling for something relevant, but only found this :slight_smile: