mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-26 19:08:57 +02: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:
committed by
Matthias Clasen
parent
c3d19b850f
commit
03c90584b8
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;
|
||||
|
Reference in New Issue
Block a user