diff options
author | Tor Lillqvist <tml@novell.com> | 2006-03-02 12:05:40 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2006-03-02 12:05:40 +0000 |
commit | e94abca52d2608a9f5c76edefec96ac08183d6d2 (patch) | |
tree | 59c9f9e6b8c50cde42472b3e2720dd10344d77b0 /gthread | |
parent | 5a2950d04112b0ed6c0a524ade58a73579b8842a (diff) |
Increase to 100. 16 was rather low. (g_private_new_win32_impl): Can't use
2006-03-02 Tor Lillqvist <tml@novell.com>
* gthread-win32.c (G_PRIVATE_MAX): Increase to 100. 16 was rather
low.
(g_private_new_win32_impl): Can't use g_error() here as
g_private_new() is called a few times by GLib internally before
the messaging system that g_error() requires is ready. Thanks to
Tim Janik for noticing. Just display a MessageBox() and abort()
instead.
Diffstat (limited to 'gthread')
-rw-r--r-- | gthread/ChangeLog | 10 | ||||
-rw-r--r-- | gthread/gthread-win32.c | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/gthread/ChangeLog b/gthread/ChangeLog index 846a15474..5f94d9d3b 100644 --- a/gthread/ChangeLog +++ b/gthread/ChangeLog @@ -1,3 +1,13 @@ +2006-03-02 Tor Lillqvist <tml@novell.com> + + * gthread-win32.c (G_PRIVATE_MAX): Increase to 100. 16 was rather + low. + (g_private_new_win32_impl): Can't use g_error() here as + g_private_new() is called a few times by GLib internally before + the messaging system that g_error() requires is ready. Thanks to + Tim Janik for noticing. Just display a MessageBox() and abort() + instead. + 2006-02-24 Matthias Clasen <mclasen@redhat.com> * === Released 2.10.0 === diff --git a/gthread/gthread-win32.c b/gthread/gthread-win32.c index e90bc601e..a04019de0 100644 --- a/gthread/gthread-win32.c +++ b/gthread/gthread-win32.c @@ -44,6 +44,7 @@ #include <process.h> #include <stdlib.h> +#include <stdio.h> #define win32_check_for_error(what) G_STMT_START{ \ if (!(what)) \ @@ -70,7 +71,7 @@ static GTryEnterCriticalSectionFunc try_enter_critical_section = NULL; /* As noted in the docs, GPrivate is a limited resource, here we take * a rather low maximum to save memory, use GStaticPrivate instead. */ -#define G_PRIVATE_MAX 16 +#define G_PRIVATE_MAX 100 static GDestroyNotify g_private_destructors[G_PRIVATE_MAX]; @@ -322,8 +323,16 @@ g_private_new_win32_impl (GDestroyNotify destructor) GPrivate *result; EnterCriticalSection (&g_thread_global_spinlock); if (g_private_next >= G_PRIVATE_MAX) - g_error ("Too many GPrivate allocated. Their number is limited to %d.\n" - "Use GStaticPrivate instead.\n", G_PRIVATE_MAX); + { + char buf[100]; + sprintf (buf, + "Too many GPrivate allocated. Their number is limited to %d.", + G_PRIVATE_MAX); + MessageBox (NULL, buf, NULL, MB_ICONERROR|MB_SETFOREGROUND); + if (IsDebuggerPresent ()) + G_BREAKPOINT (); + abort (); + } g_private_destructors[g_private_next] = destructor; result = GUINT_TO_POINTER (g_private_next); g_private_next++; |