aboutsummaryrefslogtreecommitdiff
path: root/module/menuproxy.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-02-09 01:31:36 +0100
committerJavier <dev.git@javispedro.com>2014-02-09 01:31:36 +0100
commit25f69bffe60bdd9c3dbba46967d30eb73b4f03b3 (patch)
treebad993d1db2b1249f9acc6af6aea437528422628 /module/menuproxy.cc
parent982ebc96f2c77c1f9dbddd6a4c0a776c74b425de (diff)
downloadtopmenu-qt-25f69bffe60bdd9c3dbba46967d30eb73b4f03b3.tar.gz
topmenu-qt-25f69bffe60bdd9c3dbba46967d30eb73b4f03b3.zip
fix some leaks and avoid exporting secondary menubars
Diffstat (limited to 'module/menuproxy.cc')
-rw-r--r--module/menuproxy.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/menuproxy.cc b/module/menuproxy.cc
index 5536bf5..a59a576 100644
--- a/module/menuproxy.cc
+++ b/module/menuproxy.cc
@@ -53,9 +53,11 @@ MenuProxy::~MenuProxy()
{
Q_FOREACH(GtkMenu *menu, m_menus) {
gtk_widget_destroy(GTK_WIDGET(menu));
+ g_object_unref(menu);
}
Q_FOREACH(GtkMenuItem *item, m_items) {
gtk_widget_destroy(GTK_WIDGET(item));
+ g_object_unref(item);
}
if (m_accel) {
g_object_unref(m_accel);
@@ -165,6 +167,7 @@ void MenuProxy::removeAction(QAction *action)
}
gtk_widget_destroy(GTK_WIDGET(item));
+ g_object_unref(item);
m_items.remove(action);
}
@@ -175,11 +178,12 @@ void MenuProxy::removeMenu(QMenu *menu)
GtkWidget *g_item = gtk_menu_get_attach_widget(g_menu);
Q_ASSERT(g_item);
GtkMenu *g_parent = GTK_MENU(gtk_widget_get_parent(g_item));
- Q_ASSERT(g_parent),
+ Q_ASSERT(g_parent);
menu->removeEventFilter(this);
gtk_widget_destroy(GTK_WIDGET(g_menu));
+ g_object_unref(g_menu);
m_menus.remove(menu);
}