summaryrefslogtreecommitdiff
path: root/gmodule
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1999-02-10 08:06:26 +0000
committerTim Janik <timj@src.gnome.org>1999-02-10 08:06:26 +0000
commita8ff1b4fcef1e2c53603b30b918304f7be9f27b4 (patch)
treede53f40d1b3978c7bc1dbdf0e0a6c60ac0f20dcb /gmodule
parent6c7994772297281730071874e609b62e68c211be (diff)
downloadglib-a8ff1b4fcef1e2c53603b30b918304f7be9f27b4.tar.gz
fixed errernerous code wrt to thread specific error string allocation
Wed Feb 10 07:56:33 1999 Tim Janik <timj@gtk.org> * gmodule.c (g_module_error): fixed errernerous code wrt to thread specific error string allocation handling. Wed Feb 10 06:20:30 1999 Tim Janik <timj@gtk.org> * gmutex.c (g_static_private_set): invoke destroy notifier when overwriting values, initialize new array fields with NULL. (g_static_private_free_data): do not skip destroy notification for data == NULL. * gutils.c (g_direct_equal): compare pointer values directly instead of just their guint values which is a loosing conversion for sizeof(gpointer)==8 systems. (g_get_any_init): restructured code so we don't use endless loops like while (1), which boil down to an ugly alias for goto. strip ,.* from the real name.
Diffstat (limited to 'gmodule')
-rw-r--r--gmodule/ChangeLog5
-rw-r--r--gmodule/gmodule.c13
2 files changed, 8 insertions, 10 deletions
diff --git a/gmodule/ChangeLog b/gmodule/ChangeLog
index c957056a7..74cf3ae8e 100644
--- a/gmodule/ChangeLog
+++ b/gmodule/ChangeLog
@@ -1,3 +1,8 @@
+Wed Feb 10 07:56:33 1999 Tim Janik <timj@gtk.org>
+
+ * gmodule.c (g_module_error): fixed errernerous code wrt to thread
+ specific error string allocation handling.
+
Thu Jan 21 12:40:11 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* gmodule-dl.c (_g_module_build_path):
diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c
index 99f38a6a4..463bcb16a 100644
--- a/gmodule/gmodule.c
+++ b/gmodule/gmodule.c
@@ -114,15 +114,8 @@ g_module_find_by_name (const gchar *name)
static inline void
g_module_set_error (const gchar *error)
{
- gchar* module_error = g_static_private_get (&module_error_private);
- if (module_error)
- g_free (module_error);
- if (error)
- module_error = g_strdup (error);
- else
- module_error = NULL;
+ g_static_private_set (&module_error_private, g_strdup (error), g_free);
errno = 0;
- g_static_private_set (&module_error_private, module_error, g_free);
}
@@ -246,8 +239,7 @@ g_module_open (const gchar *file_name,
return module;
}
- saved_error = g_module_error();
- g_static_private_set (&module_error_private, NULL, NULL);
+ saved_error = g_strdup (g_module_error ());
g_module_set_error (NULL);
module = g_new (GModule, 1);
@@ -281,6 +273,7 @@ g_module_open (const gchar *file_name,
}
else
g_module_set_error (saved_error);
+
g_free (saved_error);
}