discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Destructor of block never called


From: Marius Cachelin
Subject: Re: [Discuss-gnuradio] Destructor of block never called
Date: Wed, 14 Oct 2015 09:08:37 +0200

Hi,

You were right, when I click the cross button to close the window, all my new objects are deleted, even if my destructor is not called.

I tried to not using Qt GUI, and instead, using no GUI, but it is the same behavior.

Actually, during the runtime, my application records some information (# of packet lost, # of packets send...), and I want to print out these information when I close my application.

So I think I am going to find an other way to do this...

Thanks you Sylvain for your help.

Marius

2015-10-13 17:15 GMT+02:00 Sylvain Munaut <address@hidden>:
Hi,


> Actually, I don't mean the red cross in GRC. My application is run in QT GUI
> mode.
>  So, is the cross on the top of my window a stop button?

Yes, it should stop the flow graph cleanly.

However since everything uses smart pointers, it won't "delete" the
object at that point and I'm not really sure that the C++ runtime
strictly guarantees that all destructors will be called if the object
were not deleted. (Since at the process end all the resources would be
freed anyway). And GR can't really call delete itself because when
using Qt a bunch of object lifetime has been delegated to the Qt
runtime.

All in all I would _not_ rely on your destructor being called for
anything important.

stop() will be called for sure though because that part is entirely
under our control.


Another issue you might be encountering is just plain crashes ... Some
time ago I had some crash in GR that went unnoticed just because they
would only happen at flowgraph end time ... you can see that in a
debugger if you get a SIGSEGV or such.


Cheers,

   Sylvain



--
CACHELIN Marius
Ingénieur Systèmes, Réseaux et Télécommunications
address@hidden

reply via email to

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