Fix some GMenu and GMenuItem leaking

This commit is contained in:
Ryan Lortie 2011-12-01 22:53:07 -05:00
parent 3821627366
commit 75f1802a1c
2 changed files with 7 additions and 0 deletions

View File

@ -639,6 +639,12 @@ g_application_finalize (GObject *object)
if (g_application_get_default () == application)
g_application_set_default (NULL);
if (application->priv->app_menu)
g_object_unref (application->priv->app_menu);
if (application->priv->menubar)
g_object_unref (application->priv->menubar);
G_OBJECT_CLASS (g_application_parent_class)
->finalize (object);
}

View File

@ -117,6 +117,7 @@ g_menu_markup_pop_frame (GMenuMarkupState *state)
{
g_assert (prev->menu != NULL);
g_menu_append_item (prev->menu, state->frame.item);
g_object_unref (state->frame.item);
}
state->frame = *prev;