Handling source destroy in script

adhawkins

New Member
Hi all,

Been working on a Python script, which monitors the state of a source and carries out various actions based on it.

To do this I maintain a reference to the source, and have a number of signals connected to monitor. Some further reading has suggested I should also catch the 'destroy' signal, so that I can correctly release the control. However, I'm finding that my signal handler isn't being called.

Some code snippets:


Code:
        signalHandler = S.obs_source_get_signal_handler(self.alert)
        S.signal_handler_connect(signalHandler, "destroy", handle_destroy)
        S.signal_handler_connect(signalHandler, "activate", handle_activate)
        S.signal_handler_connect(signalHandler, "deactivate", handle_deactivate)
        S.signal_handler_connect(signalHandler, "mute", handle_mute)

...

def handle_destroy(callbackData):
    print("handle_destroy")

The other signal handlers I connect are being called correctly. Can anyone suggest why the 'destroy' signal isn't being correctly called?

The code (without the destroy handler - I'm trying to work on that at the moment) can be found here:


Thanks

Andy
 
Top