[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/02: Prevent memory leak when changing element text.

noreply at xfce.org noreply at xfce.org
Sun Jul 17 17:42:40 CEST 2016


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 593e70ba99af30067d3c796805be8590ffd24ca2
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sun Jul 17 11:38:34 2016 -0400

    Prevent memory leak when changing element text.
---
 panel-plugin/element.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/element.h b/panel-plugin/element.h
index 4230e70..acf16f2 100644
--- a/panel-plugin/element.h
+++ b/panel-plugin/element.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2015, 2016 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -71,22 +71,28 @@ public:
 protected:
 	void set_icon(const gchar* icon)
 	{
+		g_free(m_icon);
 		m_icon = g_strdup(icon);
 	}
 
 	void set_icon(gchar* icon)
 	{
+		g_free(m_icon);
 		m_icon = icon;
 	}
 
 	void set_text(const gchar* text)
 	{
+		g_free(m_text);
+		g_free(m_sort_key);
 		m_text = g_strdup(text);
 		m_sort_key = g_utf8_collate_key(m_text, -1);
 	}
 
 	void set_text(gchar* text)
 	{
+		g_free(m_text);
+		g_free(m_sort_key);
 		m_text = text;
 		m_sort_key = g_utf8_collate_key(m_text, -1);
 	}

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


More information about the Xfce4-commits mailing list