summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-02-18 09:24:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-02-18 09:24:23 (GMT)
commit412251e72f33525c3f5d0a1a3ec3843b9b79131e (patch)
tree058c14f6add0abd812e096c695e479c626c0fc11 /src
parentd5e94fd2895a5f9c4903bdaddf75727a54aec181 (diff)
Destroyed panel resources on exit.
Diffstat (limited to 'src')
-rw-r--r--src/gui/panels/panel.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index e70d57b..6536977 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -45,6 +45,12 @@ static void g_panel_item_init(GPanelItem *);
/* Procède à l'initialisation de l'interface de rassemblement. */
static void g_panel_item_dockable_interface_init(GtkDockableInterface *);
+/* Supprime toutes les références externes. */
+static void g_panel_item_dispose(GPanelItem *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_panel_item_finalize(GPanelItem *);
+
/* Fournit le nom court du composant encapsulable. */
static const char *gtk_panel_item_get_name(const GPanelItem *);
@@ -78,6 +84,13 @@ G_DEFINE_TYPE_WITH_CODE(GPanelItem, g_panel_item, G_TYPE_EDITOR_ITEM,
static void g_panel_item_class_init(GPanelItemClass *klass)
{
+ GObjectClass *object; /* Autre version de la classe */
+
+ object = G_OBJECT_CLASS(klass);
+
+ object->dispose = (GObjectFinalizeFunc/* ! */)g_panel_item_dispose;
+ object->finalize = (GObjectFinalizeFunc)g_panel_item_finalize;
+
g_signal_new("dock-request",
G_TYPE_PANEL_ITEM,
G_SIGNAL_RUN_LAST,
@@ -145,6 +158,46 @@ static void g_panel_item_dockable_interface_init(GtkDockableInterface *iface)
/******************************************************************************
* *
+* Paramètres : item = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_panel_item_dispose(GPanelItem *item)
+{
+ G_OBJECT_CLASS(g_panel_item_parent_class)->dispose(G_OBJECT(item));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : item = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_panel_item_finalize(GPanelItem *item)
+{
+ free(item->path);
+
+ G_OBJECT_CLASS(g_panel_item_parent_class)->finalize(G_OBJECT(item));
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : personality = nature du panneau à mettre en place. *
* name = nom associé à l'élément. *
* lname = description longue du panneau. *