[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] What conditions will cause block destructor to be
From: |
Monahan-Mitchell, Tim |
Subject: |
Re: [Discuss-gnuradio] What conditions will cause block destructor to be skipped? |
Date: |
Sat, 12 Oct 2013 16:48:30 +0000 |
> you're entering a minefield there...
Thanks for helping me navigate :)
> First of all, destructors of python objects are called whenever the python
> runtime feels like it - this often happens when you do something like
> object_name = None but it doesn't necessarily has to happen right away.
> The Garbage Collector can choose when to do it, and sometimes, it decides not
> to do it at all - if your program terminates first, this might be the case.
> Furthermore, if it decides that at the end of runtime, it should destruct its
> output stream file handles before destructing your block, your printf output
> might be lost.
So I know it isn't just dropping printf output, as other "clean-up" code does
not execute.
> So these are the pitfalls I could think of. Maybe the situation is a lot
> easier, though :) Post some code, maybe a github gist or a pastebin!
All excellent ideas, especially the GC that rightfully turns up its nose at
any destructor complaints.
So it is good to know that it is a bit out of my hands, but I can certainly
move my "clean-up" code to the point where the work() method signals WORK_DONE.
Sorry, I can't possibly air my dirty laundry on a pastebin :(.