discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Deleting a block in C++


From: Alexandru Csete
Subject: [Discuss-gnuradio] Deleting a block in C++
Date: Fri, 8 Jun 2012 20:03:35 +0200

Greetings,

Is there a smart way to delete a GNU Radio block in C++?
Until now I have been using the shared_ptr().reset() method but it
seems to me that it will only call the destructor if the parent
top_block has not been run.

This gives me problems when I try to delete and recreate a hardware
input block (e.g. gr-audio input) where the new device can be the same
as the old one, in which case it will report "device busy".
The specific code in question is here:
https://github.com/csete/gqrx/blob/afd02e241f0569e485ecbb1c312599ba60c5431c/applications/gqrx/receiver.cpp#L112

It makes no difference if I stop() the top block before attempting the reset().


Perhaps these hardware input blocks are coded incorrectly and should
close the device in their stop() method? Or is there something else we
can do?

Thanks in advance

Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]