On 14.10.2015 00:08, Marius Cachelin wrote: > 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...
As Sylvain points out, stop() might be a better choice for this. M > > Thanks you Sylvain for your help. > > Marius > > 2015-10-13 17:15 GMT+02:00 Sylvain Munaut <246...@gmail.com > <mailto:246...@gmail.com>>: > > 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/ > marius.cache...@gmail.com <mailto:marius.cache...@gmail.com> > > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio