[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 181/473: Fix memory leak when reloading applications.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:55:51 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 78c69fed938b948cc984af4fa2db2a5e57301621
Author: Graeme Gott <graeme at gottcode.org>
Date:   Tue Oct 15 18:42:25 2013 -0400

    Fix memory leak when reloading applications.
---
 src/applications_page.cpp |    3 ---
 src/launcher.cpp          |    3 ---
 2 files changed, 6 deletions(-)

diff --git a/src/applications_page.cpp b/src/applications_page.cpp
index 72f48be..15b4af6 100644
--- a/src/applications_page.cpp
+++ b/src/applications_page.cpp
@@ -130,7 +130,6 @@ void ApplicationsPage::load_applications()
 
 	// Populate map of menu data
 	m_garcon_menu = garcon_menu_new_applications();
-	g_object_ref(m_garcon_menu);
 	if (garcon_menu_load(m_garcon_menu, NULL, NULL))
 	{
 		g_signal_connect_swapped(m_garcon_menu, "reload-required", G_CALLBACK(ApplicationsPage::invalidate_applications_slot), this);
@@ -222,7 +221,6 @@ void ApplicationsPage::load_menu(GarconMenu* menu, Category* parent_category)
 	// Skip hidden categories
 	if (directory && !garcon_menu_directory_get_visible(directory))
 	{
-		g_object_unref(directory);
 		return;
 	}
 
@@ -240,7 +238,6 @@ void ApplicationsPage::load_menu(GarconMenu* menu, Category* parent_category)
 		{
 			category = parent_category->append_menu(directory);
 		}
-		g_object_unref(directory);
 	}
 
 	// Add menu elements
diff --git a/src/launcher.cpp b/src/launcher.cpp
index 7d53678..7c26e7d 100644
--- a/src/launcher.cpp
+++ b/src/launcher.cpp
@@ -79,8 +79,6 @@ static void replace_with_quoted_string(std::string& command, size_t& index, gcha
 Launcher::Launcher(GarconMenuItem* item) :
 	m_item(item)
 {
-	garcon_menu_item_ref(m_item);
-
 	// Fetch icon
 	const gchar* icon = garcon_menu_item_get_icon_name(m_item);
 	if (G_LIKELY(icon))
@@ -175,7 +173,6 @@ Launcher::Launcher(GarconMenuItem* item) :
 
 Launcher::~Launcher()
 {
-	garcon_menu_item_unref(m_item);
 }
 
 //-----------------------------------------------------------------------------

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list