Bug in g_module_close()?
- From: Roger Leigh <rleigh whinlatter ukfsn org>
- To: gtk-list gnome org
- Subject: Bug in g_module_close()?
- Date: Sun, 08 May 2005 22:50:55 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have some plugins which are loaded using g_module_open(), and later
closed with g_module_close(). The modules all have defined within
them:
const gchar *
g_module_check_init (GModule *module)
{
// Stuff is registered with the main app using uterm_control_register()
}
void
g_module_unload (GModule *module)
{
g_fprintf(stderr, "module unreg0: %s\n", g_module_name(module)); // Segfaults
uterm_control_unregister_module_internal(g_module_name(module));
}
While g_module_check_init() is running, and before I call
g_module_unload(), I can call g_module_name() to get the name of the
module. The name is used to track which objects are owned by the
module, and I use this in the module cleanup.
However... g_module_name is returning neither a NULL pointer nor a
NUL-terminated string while using the module structure passed to
g_module_unload(), which seems odd. Prior to the unload, it returned
"/tmp/g/lib/uterm/0.1.0/modules/libiso646-c0.so", if I call
g_module_name in g_module_unload it trashes the stack and segfaults.
Is this a bug?
Thanks,
Roger
- --
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
iD8DBQFCfom5VcFcaSW/uEgRAsuDAKCxGXBoeCr3SZw2+2yfqWQo/swHwwCcD6b3
D1sSDD0TGBWakecp5mJ7LCo=
=Lgbh
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]