[C++-sig] Re: Any way of executing something on unload of a Boost.Python module?

David Abrahams dave at boost-consulting.com
Thu Sep 25 22:29:08 CEST 2003


"Niall Douglas" <s_sourceforge at nedprod.com> writes:

> Firstly, I'll just thank everything in here for all the help over the 
> last few weeks. In fact:
>
>>>> from TnFOX import *
> Thread 0x42c (Randomness monitor) started
>>>> a=FXFile("foo.txt")
>>>> a.writeBlock("Niall", 5)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> IOError: Not open for writing (code 0xFFFA file 
> d:\tornado\tclient\tnfox\src\fxfile.cxx line 398)
> Stack backtrace:
> 0x00B5D0EA:<unknown>            <unknown>
>                                  (file <unknown>                 line 
> no 0)
> 0x00B5DA5F:TnFOX-0.4d7.dll      FX::operator- +0x104be
>                                  (file <unknown>                 line 
> no 0)
> <backtrace ends>
>
> Wow! You all might not quite appreciate how much this means to me. 
> More than a month of labouring part-time and it finally all works!

*That's* called "working?"  I guess if you're happy, I'm happy.

> The single caveat is that the randomness thread you see started above 
> gets terminated when you unload the module (I'd much prefer a chance 
> to shut it down nicely). I can't find anything in the docs about how 
> to do this.

?? Python extension modules are never unloaded.

Do you mean you're calling Py_Finalize()?  Because that's not
supported by Boost.Python (yet).


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list