[PATCH] dtors run twice on dll detach (update)

Thomas Pfaff tpfaff@gmx.net
Wed Apr 17 00:08:00 GMT 2002

I am sorry for the previous patch, it was incomplete. This is hopefully a
better one:

On Tue, 16 Apr 2002, Thomas Pfaff wrote:

> I ran into a problem when is was trying to build STLPort-4.5.3 as dll
> (if
> somebody is interested i can send him my patches). A program build with
> this dll crashed in _free_r on termination. After testing a while i
> discovered that the dtors were run twice, the first time from
> dll_global_dtors, the second time from dll_list::detach which resulted
> in
> a duplicated free for the same pointer.
> Since i can not judge which function is obsolete (i guess
> dll_global_dtors
> is) i have attached a small patch that will make sure that the dtors run
> only once.
> Regards
> Thomas
> 2002-04-16  Thomas Pfaff  <tpfaff@gmx.net>
> 	* dll_init.h (per_process::dtors_run): New member.
> 	* dll_init.cc (per_module::run_dtors): Run dtors only once.
> 	(dll::init): Initialize dtors_run flag.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: run_dtors.patch
Type: application/octet-stream
Size: 1021 bytes
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020417/ffa19dd0/attachment.obj>

More information about the Cygwin-patches mailing list