mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
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:
parent
c3d19b850f
commit
03c90584b8
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
10
glib/gmain.c
10
glib/gmain.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user