I am writing a gnuradio sink block for custom SDR hardware. When the gnuradio program is closed, I need to make sure that the power amplifiers are disabled (as they draw quite a bit of power and produce a lot of heat). I tried doing this with a class destructor thinking it would be called upon program termination, however it was not. Does gnuradio provide a way to run cleanup upon program termination?
You could overload the stop
method of the gr::block
base class. It's meant for exactly that!