[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 10/96: Return to explicit memory management of the applet instance, dont know what Im doing here

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:15 CET 2014


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

nick pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit 13ffc4f8e6ade30717addbaa2b55ec4b1589aea7
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Tue Oct 22 20:21:47 2013 +0100

    Return to explicit memory management of the applet instance, dont know what Im doing here
---
 src/applet.cpp |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/applet.cpp b/src/applet.cpp
index eacc8aa..cf091c1 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -66,7 +66,7 @@ extern "C" void applet_construct(XfcePanelPlugin* plugin)
     xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
 
     // Actually creating the applet/plugin
-    Applet *applet = Gtk::manage(new Applet(plugin));
+    Applet *applet = new Applet(plugin);
     applet->show();
   }
   catch(const Glib::Error &ex)
@@ -77,13 +77,12 @@ extern "C" void applet_construct(XfcePanelPlugin* plugin)
 }
 
 // Does not need C linkage as its called via a function pointer?
-// Not needed as GLib manages the lifetime of the applet
-/*void applet_free(XfcePanelPlugin*, Applet* applet)
+void applet_free(XfcePanelPlugin*, Applet* applet)
 {
   // Called by 'free-data' signal
   delete applet;
   applet = NULL;
-}*/
+}
 
 // Helpers for popping up the various things
 void display_preferences(void *applet)
@@ -272,9 +271,8 @@ Applet::Applet(XfcePanelPlugin *plugin)
     G_CALLBACK(display_preferences), this);
 
   // Hooking into plugin destruction signal
-  // Not needed as Glib manages the lifetime of the applet
-	/*g_signal_connect_swapped(panel_applet, "free-data", G_CALLBACK(applet_free),
-    this);*/
+  g_signal_connect_swapped(panel_applet, "free-data", G_CALLBACK(applet_free),
+    this);
 
   /* TODO: Not sure if I really need to support this
 #if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))

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


More information about the Xfce4-commits mailing list