mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-07 00:18:44 +02:00
Wrapping atexit() is a bad idea on Windows, where the EXE and each DLL
2005-08-31 Tor Lillqvist <tml@novell.com> * glib/gutils.h: Wrapping atexit() is a bad idea on Windows, where the EXE and each DLL have their own atexit function chains. #define g_atexit as atexit instead. This means it has a better chance of doing what the caller wants. For instance, gtkhtml calls g_atexit() registering a function in gtkhtml itself. This caused a crash when g_atexit() was implemented as a function in the GLib DLL. The gtkhtml DLL was already unloaded by the time the GLib DLL got unloaded. * glib/gutils.c: #undef the #define mentioned above, to also get a real g_atexit() into the DLL for backward compatibility. Document the Windows behaviour of g_atexit(), and document the varying ways atexit() can behave in the context of dynamically loaded modules on Unix.
This commit is contained in:
committed by
Tor Lillqvist
parent
49003b01ff
commit
130763338c
@@ -1,3 +1,21 @@
|
||||
2005-08-31 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* glib/gutils.h: Wrapping atexit() is a bad idea on Windows, where
|
||||
the EXE and each DLL have their own atexit function chains.
|
||||
|
||||
#define g_atexit as atexit instead. This means it has a
|
||||
better chance of doing what the caller wants. For instance,
|
||||
gtkhtml calls g_atexit() registering a function in gtkhtml
|
||||
itself. This caused a crash when g_atexit() was implemented as a
|
||||
function in the GLib DLL. The gtkhtml DLL was already unloaded by
|
||||
the time the GLib DLL got unloaded.
|
||||
|
||||
* glib/gutils.c: #undef the #define mentioned above, to also get a
|
||||
real g_atexit() into the DLL for backward compatibility. Document
|
||||
the Windows behaviour of g_atexit(), and document the varying ways
|
||||
atexit() can behave in the context of dynamically loaded modules
|
||||
on Unix.
|
||||
|
||||
2005-08-31 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/glib.symbols:
|
||||
|
Reference in New Issue
Block a user