[gnome-commander] styles: add destrucftor for GnomeCmdColorTheme



commit f42d3bb3bcaae9c703c05c0ae3ee0fd6e3e3df49
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Fri Nov 25 21:13:06 2011 +0100

    styles: add destrucftor for GnomeCmdColorTheme

 src/gnome-cmd-data.h  |    1 -
 src/gnome-cmd-types.h |   25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 20e2dbd..1429507 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -188,7 +188,6 @@ struct GnomeCmdData
 
         ~Options()
         {
-            // free color_themes    //  FIXME
             g_free (date_format);
             g_free (list_font);
             g_free (theme_icon_dir);
diff --git a/src/gnome-cmd-types.h b/src/gnome-cmd-types.h
index 65a2b9f..ba263db 100644
--- a/src/gnome-cmd-types.h
+++ b/src/gnome-cmd-types.h
@@ -93,6 +93,31 @@ struct GnomeCmdColorTheme
     GdkColor *norm_fg, *norm_bg;
     GdkColor *curs_fg, *curs_bg;
     GdkColor *alt_fg, *alt_bg;
+
+    GnomeCmdColorTheme()
+    {
+        // respect_theme = TRUE;    // FIXME
+        // sel_fg = NULL;           // FIXME
+        // sel_bg = NULL;           // FIXME
+        // norm_fg = NULL;          // FIXME
+        // norm_bg = NULL;          // FIXME
+        // curs_fg = NULL;          // FIXME
+        // curs_bg = NULL;          // FIXME
+        // alt_fg = NULL;           // FIXME
+        // alt_bg = NULL;           // FIXME
+    }
+
+    ~GnomeCmdColorTheme()
+    {
+        if (sel_fg)     gdk_color_free (sel_fg);
+        if (sel_bg)     gdk_color_free (sel_bg);
+        if (norm_fg)    gdk_color_free (norm_fg);
+        if (norm_bg)    gdk_color_free (norm_bg);
+        if (curs_fg)    gdk_color_free (curs_fg);
+        if (curs_bg)    gdk_color_free (curs_bg);
+        if (alt_fg)     gdk_color_free (alt_fg);
+        if (alt_bg)     gdk_color_free (alt_bg);
+    }
 };
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]