Don't leak the dispatch struct. (#321886)

2006-06-05  Matthias Clasen  <mclasen@redhat.com>

	* glib/gmain.c (get_dispatch): Don't leak the
	dispatch struct.  (#321886)
This commit is contained in:
Matthias Clasen 2006-06-05 15:02:51 +00:00 committed by Matthias Clasen
parent c3d19b850f
commit 03c90584b8
3 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2006-06-05 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c (get_dispatch): Don't leak the
dispatch struct. (#321886)
* tests/strtod-test.c: Add some tests involving
leading whitespace.

View File

@ -1,5 +1,8 @@
2006-06-05 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c (get_dispatch): Don't leak the
dispatch struct. (#321886)
* tests/strtod-test.c: Add some tests involving
leading whitespace.

View File

@ -107,7 +107,7 @@ typedef struct _GMainDispatch GMainDispatch;
struct _GMainDispatch
{
gint depth;
GSList *source;
GSList *source; /* stack of current sources */
};
struct _GMainContext
@ -1719,6 +1719,12 @@ g_get_current_time (GTimeVal *result)
#endif
}
static void
g_main_dispatch_free (gpointer dispatch)
{
g_slice_free (GMainDispatch, dispatch);
}
/* Running the main loop */
static GMainDispatch *
@ -1729,7 +1735,7 @@ get_dispatch (void)
if (!dispatch)
{
dispatch = g_slice_new0 (GMainDispatch);
g_static_private_set (&depth_private, dispatch, NULL);
g_static_private_set (&depth_private, dispatch, g_main_dispatch_free);
}
return dispatch;