[Bug target/27319] C++ class object destructors are not called for static class objects in a shared library when dlclose is called.

hbd_bugreports at earthlink dot net gcc-bugzilla@gcc.gnu.org
Tue Apr 25 23:46:00 GMT 2006



------- Comment #4 from hbd_bugreports at earthlink dot net  2006-04-25 23:46 -------
Subject: Re:  C++ class object destructors are not called
 for static class objects in a shared library when dlclose is called.

pinskia at gcc dot gnu dot org wrote:

>------- Comment #3 from pinskia at gcc dot gnu dot org  2006-04-25 22:14 -------
>(In reply to comment #2)
>  
>
>>Subject: Re:  C++ class object destructors are not called
>> for static class objects in a shared library when dlclose is called.
>>So.... You are telling me this is not a gcc problem but a limitation in 
>>CYGWIN.   (I'm not really surprised.)
>>... In which case I resort to my work-around of eliminating static class 
>>objects declared in the body of functions that will be used in the 
>>shared library.
>>Thanks for the prompt reply,
>>Harry Dellicker
>>    
>>
>
>
>No, it is a GCC bug but it is hard to get fixed really as you need to implement
>an __cxa_atexit for Windows.  Now Cygwin could implement __cxa_atexit but that
>does not help other windows targets.
>
>
>  
>
Ok,  thanks for the clarification.  ...But, for now, I guess I still 
have to resort to my workaround. :-(

At least I do have a workaround.

Harry


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27319



More information about the Gcc-bugs mailing list