From 250d2773aa372434b721a4e72bff5da7b4f3fb4e Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Tue, 22 Jul 2014 21:38:30 +0000
Subject: Used in the right way some features of GLib classes in the GUI code.

git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@382 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
---
 ChangeLog                     | 19 ++++++++++
 plugins/pychrysa/gui/editem.c |  6 +--
 src/gui/editem-int.h          | 12 +++---
 src/gui/editem.c              | 61 ++++++++++++++++++++++--------
 src/gui/menus/menubar.c       | 57 +++++++++++++++++++++++++++-
 src/gui/panels/glance.c       | 63 +++++++++++++++++++++++++++++--
 src/gui/panels/strings.c      | 87 ++++++++++++++++++++++++++++++++++++++++---
 src/gui/panels/strings.h      | 10 ++---
 src/gui/panels/symbols.c      | 59 ++++++++++++++++++++++++++++-
 src/gui/status.c              | 63 ++++++++++++++++++++++++++++++-
 src/gui/tb/portions.c         |  3 +-
 src/gui/tb/source.c           |  5 ++-
 12 files changed, 400 insertions(+), 45 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 68d7c81..5eb2020 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+14-07-22  Cyrille Bagard <nocbos@gmail.com>
+
+	* plugins/pychrysa/gui/editem.c:
+	Disable some parts of the GUI.
+
+	* src/gui/editem.c:
+	* src/gui/editem-int.h:
+	* src/gui/menus/menubar.c:
+	* src/gui/panels/glance.c:
+	* src/gui/panels/strings.c:
+	* src/gui/panels/strings.h:
+	* src/gui/panels/symbols.c:
+	* src/gui/status.c:
+	Use in the right way some features of GLib classes in the GUI code.
+
+	* src/gui/tb/portions.c:
+	* src/gui/tb/source.c:
+	Disable some parts of the GUI.
+
 14-07-10  Cyrille Bagard <nocbos@gmail.com>
 
 	* configure.ac:
diff --git a/plugins/pychrysa/gui/editem.c b/plugins/pychrysa/gui/editem.c
index d14d66a..7a40a04 100644
--- a/plugins/pychrysa/gui/editem.c
+++ b/plugins/pychrysa/gui/editem.c
@@ -341,9 +341,9 @@ static PyObject *py_editor_item_register(PyObject *self, PyObject *args)
 
     item = G_EDITOR_ITEM(pygobject_get(self));
 
-    item->update_binary = _update_editor_item_for_binary_python_wrapper;
-    item->update_view = _update_editor_item_for_view_python_wrapper;
-    item->update_content = _update_editor_item_for_view_content_python_wrapper;
+    //item->update_binary = _update_editor_item_for_binary_python_wrapper;
+    //item->update_view = _update_editor_item_for_view_python_wrapper;
+    //item->update_content = _update_editor_item_for_view_content_python_wrapper;
 
     Py_INCREF(self);
     register_editor_item(item);
diff --git a/src/gui/editem-int.h b/src/gui/editem-int.h
index a895a45..eafac04 100644
--- a/src/gui/editem-int.h
+++ b/src/gui/editem-int.h
@@ -61,12 +61,6 @@ struct _GEditorItem
     const char *name;                       /* Nom du panneau              */
     GtkWidget *widget;                      /* Composant GTK d'affichage   */
 
-    update_item_binary_fc update_binary;    /* Changement de binaire       */
-    update_item_view_fc update_view;        /* Rechargement dû à une vue   */
-    update_item_view_fc update_content;     /* Rechargement dû à un contenu*/
-    focus_addr_fc focus_addr;               /* Prête attention à une addr. */
-    update_project_fc update_project;       /* Actualisation des binaires  */
-
 };
 
 
@@ -75,6 +69,12 @@ struct _GEditorItemClass
 {
     GObjectClass parent;                    /* A laisser en premier        */
 
+    update_item_binary_fc update_binary;    /* Changement de binaire       */
+    update_item_view_fc update_view;        /* Rechargement dû à une vue   */
+    update_item_view_fc update_content;     /* Rechargement dû à un contenu*/
+    focus_addr_fc focus_addr;               /* Prête attention à une addr. */
+    update_project_fc update_project;       /* Actualisation des binaires  */
+
 };
 
 
diff --git a/src/gui/editem.c b/src/gui/editem.c
index 790ef0c..c8befec 100644
--- a/src/gui/editem.c
+++ b/src/gui/editem.c
@@ -210,13 +210,19 @@ void register_editor_item(GEditorItem *item)
 
 void change_editor_items_current_binary(GObject *ref, GLoadedBinary *binary)
 {
-    GEditorItem *iter;                     /* Boucle de parcours          */
+    GEditorItem *iter;                      /* Boucle de parcours          */
+    GEditorItemClass *klass;                /* Classe correspondante       */
 
     g_object_set_data(ref, "current_binary", binary);
 
     editem_list_for_each(iter, _editem_list)
-        if (iter->update_binary != NULL)
-            iter->update_binary(iter, binary);
+    {
+        klass = G_EDITOR_ITEM_GET_CLASS(iter);
+
+        if (klass->update_binary != NULL)
+            klass->update_binary(iter, binary);
+
+    }
 
 }
 
@@ -236,13 +242,20 @@ void change_editor_items_current_binary(GObject *ref, GLoadedBinary *binary)
 
 void change_editor_items_current_view(GObject *ref, GtkViewPanel *view)
 {
-    GEditorItem *iter;                     /* Boucle de parcours          */
+    GEditorItem *iter;                      /* Boucle de parcours          */
+    GEditorItemClass *klass;                /* Classe correspondante       */
 
     g_object_set_data(ref, "current_view", view);
 
     editem_list_for_each(iter, _editem_list)
-        if (iter->update_view != NULL)
-            iter->update_view(iter, view);
+    {
+        klass = G_EDITOR_ITEM_GET_CLASS(iter);
+
+        if (klass->update_view != NULL)
+            klass->update_view(iter, view);
+
+
+    }
 
 }
 
@@ -262,11 +275,17 @@ void change_editor_items_current_view(GObject *ref, GtkViewPanel *view)
 
 void change_editor_items_current_view_content(GtkViewPanel *view)
 {
-    GEditorItem *iter;                     /* Boucle de parcours          */
+    GEditorItem *iter;                      /* Boucle de parcours          */
+    GEditorItemClass *klass;                /* Classe correspondante       */
 
     editem_list_for_each(iter, _editem_list)
-        if (iter->update_content != NULL)
-            iter->update_content(iter, view);
+    {
+        klass = G_EDITOR_ITEM_GET_CLASS(iter);
+
+        if (klass->update_content != NULL)
+            klass->update_content(iter, view);
+
+    }
 
 }
 
@@ -286,11 +305,17 @@ void change_editor_items_current_view_content(GtkViewPanel *view)
 
 void focus_address_in_editor_items(vmpa_t addr, GtkWidget *source)
 {
-    GEditorItem *iter;                     /* Boucle de parcours          */
+    GEditorItem *iter;                      /* Boucle de parcours          */
+    GEditorItemClass *klass;                /* Classe correspondante       */
 
     editem_list_for_each(iter, _editem_list)
-        if (iter->focus_addr != NULL && iter->widget != source)
-            iter->focus_addr(iter, addr, source);
+    {
+        klass = G_EDITOR_ITEM_GET_CLASS(iter);
+
+        if (klass->focus_addr != NULL && iter->widget != source)
+            klass->focus_addr(iter, addr, source);
+
+    }
 
 }
 
@@ -309,10 +334,16 @@ void focus_address_in_editor_items(vmpa_t addr, GtkWidget *source)
 
 void update_project_area(GStudyProject *project)
 {
-    GEditorItem *iter;                     /* Boucle de parcours          */
+    GEditorItem *iter;                      /* Boucle de parcours          */
+    GEditorItemClass *klass;                /* Classe correspondante       */
 
     editem_list_for_each(iter, _editem_list)
-        if (iter->update_project != NULL)
-            iter->update_project(iter, project);
+    {
+        klass = G_EDITOR_ITEM_GET_CLASS(iter);
+
+        if (klass->update_project != NULL)
+            klass->update_project(iter, project);
+
+    }
 
 }
diff --git a/src/gui/menus/menubar.c b/src/gui/menus/menubar.c
index aaee25b..77ff7cd 100644
--- a/src/gui/menus/menubar.c
+++ b/src/gui/menus/menubar.c
@@ -66,6 +66,12 @@ static void g_menu_bar_class_init(GMenuBarClass *);
 /* Initialise une instance de la barre de menus pour l'éditeur. */
 static void g_menu_bar_init(GMenuBar *);
 
+/* Supprime toutes les références externes. */
+static void g_menu_bar_dispose(GMenuBar *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_menu_bar_finalize(GMenuBar *);
+
 /* Lance une actualisation du fait d'un changement de vue. */
 static void update_menu_bar_for_view(GMenuBar *, GtkViewPanel *);
 
@@ -92,6 +98,18 @@ G_DEFINE_TYPE(GMenuBar, g_menu_bar, G_TYPE_EDITOR_ITEM);
 
 static void g_menu_bar_class_init(GMenuBarClass *klass)
 {
+    GObjectClass *object;                   /* Autre version de la classe  */
+    GEditorItemClass *editem;               /* Encore une autre vision...  */
+
+    object = G_OBJECT_CLASS(klass);
+
+    object->dispose = (GObjectFinalizeFunc/* ! */)g_menu_bar_dispose;
+    object->finalize = (GObjectFinalizeFunc)g_menu_bar_finalize;
+
+    editem = G_EDITOR_ITEM_CLASS(klass);
+
+    editem->update_view = (update_item_view_fc)update_menu_bar_for_view;
+    editem->update_project = (update_project_fc)update_menu_bar_for_project;
 
 }
 
@@ -119,8 +137,43 @@ static void g_menu_bar_init(GMenuBar *bar)
     item->widget = gtk_menu_bar_new();
     gtk_widget_show(item->widget);
 
-    item->update_view = (update_item_view_fc)update_menu_bar_for_view;
-    item->update_project = (update_project_fc)update_menu_bar_for_project;
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : bar = instance d'objet GLib à traiter.                       *
+*                                                                             *
+*  Description : Supprime toutes les références externes.                     *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_menu_bar_dispose(GMenuBar *bar)
+{
+    G_OBJECT_CLASS(g_menu_bar_parent_class)->dispose(G_OBJECT(bar));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : bar = instance d'objet GLib à traiter.                       *
+*                                                                             *
+*  Description : Procède à la libération totale de la mémoire.                *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_menu_bar_finalize(GMenuBar *bar)
+{
+    G_OBJECT_CLASS(g_menu_bar_parent_class)->finalize(G_OBJECT(bar));
 
 }
 
diff --git a/src/gui/panels/glance.c b/src/gui/panels/glance.c
index ab80ba2..97d57d1 100644
--- a/src/gui/panels/glance.c
+++ b/src/gui/panels/glance.c
@@ -75,6 +75,12 @@ static void g_glance_panel_class_init(GGlancePanelClass *);
 /* Initialise une instance de panneau d'aperçu rapide. */
 static void g_glance_panel_init(GGlancePanel *);
 
+/* Supprime toutes les références externes. */
+static void g_glance_panel_dispose(GGlancePanel *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_glance_panel_finalize(GGlancePanel *);
+
 /* Définit une fois et au bon moment le fond de l'aperçu rapide. */
 static void define_glance_bg(GtkWidget *, GGlancePanel *);
 
@@ -128,6 +134,18 @@ G_DEFINE_TYPE(GGlancePanel, g_glance_panel, G_TYPE_PANEL_ITEM);
 
 static void g_glance_panel_class_init(GGlancePanelClass *klass)
 {
+    GObjectClass *object;                   /* Autre version de la classe  */
+    GEditorItemClass *editem;               /* Encore une autre vision...  */
+
+    object = G_OBJECT_CLASS(klass);
+
+    object->dispose = (GObjectFinalizeFunc/* ! */)g_glance_panel_dispose;
+    object->finalize = (GObjectFinalizeFunc)g_glance_panel_finalize;
+
+    editem = G_EDITOR_ITEM_CLASS(klass);
+
+    editem->update_view = (update_item_view_fc)update_glance_panel_for_view;
+    editem->update_content = (update_item_view_fc)update_glance_panel_for_view_content;
 
 }
 
@@ -161,9 +179,6 @@ static void g_glance_panel_init(GGlancePanel *panel)
     gtk_container_add(GTK_CONTAINER(base->widget), area);
     gtk_widget_show(base->widget);
 
-    base->update_view = (update_item_view_fc)update_glance_panel_for_view;
-    base->update_content = (update_item_view_fc)update_glance_panel_for_view_content;
-
     gtk_widget_set_size_request(base->widget, 300, 300);
 
     g_signal_connect(G_OBJECT(area), "draw",
@@ -180,6 +195,48 @@ static void g_glance_panel_init(GGlancePanel *panel)
 
 }
 
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : panel = instance d'objet GLib à traiter.                     *
+*                                                                             *
+*  Description : Supprime toutes les références externes.                     *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_glance_panel_dispose(GGlancePanel *panel)
+{
+    if (panel->cache != NULL)
+        cairo_surface_destroy(panel->cache);
+
+    G_OBJECT_CLASS(g_glance_panel_parent_class)->dispose(G_OBJECT(panel));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : panel = instance d'objet GLib à traiter.                     *
+*                                                                             *
+*  Description : Procède à la libération totale de la mémoire.                *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_glance_panel_finalize(GGlancePanel *panel)
+{
+    G_OBJECT_CLASS(g_glance_panel_parent_class)->finalize(G_OBJECT(panel));
+
+}
+
+
 /******************************************************************************
 *                                                                             *
 *  Paramètres  : ref = espace de référencement global.                        *
diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c
index aac5f6f..630b175 100644
--- a/src/gui/panels/strings.c
+++ b/src/gui/panels/strings.c
@@ -72,6 +72,18 @@ typedef enum _StringsColumn
 } StringsColumn;
 
 
+/* Initialise la classe des panneaux d'affichage de chaînes. */
+static void g_strings_panel_class_init(GStringsPanelClass *);
+
+/* Initialise une instance de panneau d'affichage des chaînes. */
+static void g_strings_panel_init(GStringsPanel *);
+
+/* Supprime toutes les références externes. */
+static void g_strings_panel_dispose(GStringsPanel *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_strings_panel_finalize(GStringsPanel *);
+
 /* Réagit à un changement d'affichage principal de contenu. */
 static void change_strings_panel_current_binary(GStringsPanel *, GLoadedBinary *);
 
@@ -93,7 +105,7 @@ static void mcb_strings_copy(GtkMenuItem *, GtkTreeView *);
 /* ---------------------------------------------------------------------------------- */
 
 
-/* Indique le type définit pour un panneau d'aperçu de graphiques. */
+/* Indique le type définit pour un panneau d'affichage des chaînes. */
 G_DEFINE_TYPE(GStringsPanel, g_strings_panel, G_TYPE_PANEL_ITEM);
 
 
@@ -101,7 +113,7 @@ G_DEFINE_TYPE(GStringsPanel, g_strings_panel, G_TYPE_PANEL_ITEM);
 *                                                                             *
 *  Paramètres  : klass = classe à initialiser.                                *
 *                                                                             *
-*  Description : Initialise la classe des panneaux d'aperçu de graphiques.    *
+*  Description : Initialise la classe des panneaux d'affichage de chaînes.    *
 *                                                                             *
 *  Retour      : -                                                            *
 *                                                                             *
@@ -111,6 +123,17 @@ G_DEFINE_TYPE(GStringsPanel, g_strings_panel, G_TYPE_PANEL_ITEM);
 
 static void g_strings_panel_class_init(GStringsPanelClass *klass)
 {
+    GObjectClass *object;                   /* Autre version de la classe  */
+    GEditorItemClass *editem;               /* Encore une autre vision...  */
+
+    object = G_OBJECT_CLASS(klass);
+
+    object->dispose = (GObjectFinalizeFunc/* ! */)g_strings_panel_dispose;
+    object->finalize = (GObjectFinalizeFunc)g_strings_panel_finalize;
+
+    editem = G_EDITOR_ITEM_CLASS(klass);
+
+    editem->update_binary = (update_item_binary_fc)change_strings_panel_current_binary;
 
 }
 
@@ -119,7 +142,7 @@ static void g_strings_panel_class_init(GStringsPanelClass *klass)
 *                                                                             *
 *  Paramètres  : panel = instance à initialiser.                              *
 *                                                                             *
-*  Description : Initialise une instance de panneau d'aperçu de graphiques.   *
+*  Description : Initialise une instance de panneau d'affichage des chaînes.  *
 *                                                                             *
 *  Retour      : -                                                            *
 *                                                                             *
@@ -198,9 +221,50 @@ static void g_strings_panel_init(GStringsPanel *panel)
 
 /******************************************************************************
 *                                                                             *
+*  Paramètres  : panel = instance d'objet GLib à traiter.                     *
+*                                                                             *
+*  Description : Supprime toutes les références externes.                     *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_strings_panel_dispose(GStringsPanel *panel)
+{
+    if (panel->binary != NULL)
+        g_object_unref(G_OBJECT(panel->binary));
+
+    G_OBJECT_CLASS(g_strings_panel_parent_class)->dispose(G_OBJECT(panel));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : panel = instance d'objet GLib à traiter.                     *
+*                                                                             *
+*  Description : Procède à la libération totale de la mémoire.                *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_strings_panel_finalize(GStringsPanel *panel)
+{
+    G_OBJECT_CLASS(g_strings_panel_parent_class)->finalize(G_OBJECT(panel));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
 *  Paramètres  : ref = espace de référencement global.                        *
 *                                                                             *
-*  Description : Crée un panneau d'affichage des symboles.                    *
+*  Description : Crée un panneau d'affichage des chaînes.                     *
 *                                                                             *
 *  Retour      : Adresse de la structure mise en place.                       *
 *                                                                             *
@@ -226,7 +290,7 @@ GEditorItem *g_strings_panel_new(GObject *ref)
 *                                                                             *
 *  Paramètres  : ref = espace de référencement global.                        *
 *                                                                             *
-*  Description : Construit et intègre un panneau d'affichage des symboles.    *
+*  Description : Construit et intègre un panneau d'affichage des chaînes.     *
 *                                                                             *
 *  Retour      : Adresse du panneau mis en place.                             *
 *                                                                             *
@@ -241,7 +305,6 @@ GPanelItem *create_strings_panel(GObject *ref)
     result = g_strings_panel_new(ref);
 
     /* Enregistre correctement le tout */
-    result->update_binary = (update_item_binary_fc)change_strings_panel_current_binary;
     register_editor_item(result);
 
     return G_PANEL_ITEM(result);
@@ -274,6 +337,18 @@ static void change_strings_panel_current_binary(GStringsPanel *panel, GLoadedBin
     char *text;                             /* Version imprimable du texte */
     GtkTreeIter iter;                       /* Point d'insertion           */
 
+    /* Basculement du binaire utilisé */
+
+    if (panel->binary != NULL)
+        g_object_unref(G_OBJECT(panel->binary));
+
+    panel->binary = binary;
+
+    if (panel->binary != NULL)
+        g_object_ref(G_OBJECT(panel->binary));
+
+    /* Actualisation de l'affichage */
+
     store = g_object_get_data(G_OBJECT(panel), "store");
 
     format = g_loaded_binary_get_format(binary);
diff --git a/src/gui/panels/strings.h b/src/gui/panels/strings.h
index 04558fb..556dcbe 100644
--- a/src/gui/panels/strings.h
+++ b/src/gui/panels/strings.h
@@ -44,20 +44,20 @@
 #define G_STRINGS_PANEL_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_STRINGS_PANEL, GStringsPanelClass))
 
 
-/* Panneau d'affichage des symboles (instance) */
+/* Panneau d'affichage des chaînes (instance) */
 typedef struct _GStringsPanel GStringsPanel;
 
-/* Panneau d'affichage des symboles (classe) */
+/* Panneau d'affichage des chaînes (classe) */
 typedef struct _GStringsPanelClass GStringsPanelClass;
 
 
-/* Indique le type définit pour un panneau d'affichage des symboles. */
+/* Indique le type définit pour un panneau d'affichage des chaînes. */
 GType g_strings_panel_get_type(void);
 
-/* Crée un panneau d'affichage des symboles. */
+/* Crée un panneau d'affichage des chaînes. */
 GEditorItem *g_strings_panel_new(GObject *);
 
-/* Construit et intègre un panneau d'affichage des symboles. */
+/* Construit et intègre un panneau d'affichage des chaînes. */
 GPanelItem *create_strings_panel(GObject *);
 
 
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index 064c31d..959fb2c 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -87,6 +87,12 @@ static void g_symbols_panel_class_init(GSymbolsPanelClass *);
 /* Initialise une instance de panneau d'aperçu de graphiques. */
 static void g_symbols_panel_init(GSymbolsPanel *);
 
+/* Supprime toutes les références externes. */
+static void g_symbols_panel_dispose(GSymbolsPanel *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_symbols_panel_finalize(GSymbolsPanel *);
+
 /* Réagit au changement d'affichage des symboles. */
 static void on_symbols_display_change(GtkToggleToolButton *, GSymbolsPanel *);
 
@@ -166,6 +172,17 @@ G_DEFINE_TYPE(GSymbolsPanel, g_symbols_panel, G_TYPE_PANEL_ITEM);
 
 static void g_symbols_panel_class_init(GSymbolsPanelClass *klass)
 {
+    GObjectClass *object;                   /* Autre version de la classe  */
+    GEditorItemClass *editem;               /* Encore une autre vision...  */
+
+    object = G_OBJECT_CLASS(klass);
+
+    object->dispose = (GObjectFinalizeFunc/* ! */)g_symbols_panel_dispose;
+    object->finalize = (GObjectFinalizeFunc)g_symbols_panel_finalize;
+
+    editem = G_EDITOR_ITEM_CLASS(klass);
+
+    editem->update_binary = (update_item_binary_fc)change_symbols_panel_current_binary;
 
 }
 
@@ -326,6 +343,47 @@ static void g_symbols_panel_init(GSymbolsPanel *panel)
 
 /******************************************************************************
 *                                                                             *
+*  Paramètres  : panel = instance d'objet GLib à traiter.                     *
+*                                                                             *
+*  Description : Supprime toutes les références externes.                     *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_symbols_panel_dispose(GSymbolsPanel *panel)
+{
+    if (panel->binary != NULL)
+        g_object_unref(G_OBJECT(panel->binary));
+
+    G_OBJECT_CLASS(g_symbols_panel_parent_class)->dispose(G_OBJECT(panel));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : panel = instance d'objet GLib à traiter.                     *
+*                                                                             *
+*  Description : Procède à la libération totale de la mémoire.                *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_symbols_panel_finalize(GSymbolsPanel *panel)
+{
+    G_OBJECT_CLASS(g_symbols_panel_parent_class)->finalize(G_OBJECT(panel));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
 *  Paramètres  : ref = espace de référencement global.                        *
 *                                                                             *
 *  Description : Crée un panneau d'affichage des symboles.                    *
@@ -369,7 +427,6 @@ GPanelItem *create_symbols_panel(GObject *ref)
     result = g_symbols_panel_new(ref);
 
     /* Enregistre correctement le tout */
-    result->update_binary = (update_item_binary_fc)change_symbols_panel_current_binary;
     register_editor_item(result);
 
     return G_PANEL_ITEM(result);
diff --git a/src/gui/status.c b/src/gui/status.c
index c059f4e..c29a69e 100644
--- a/src/gui/status.c
+++ b/src/gui/status.c
@@ -64,6 +64,12 @@ static void g_status_info_class_init(GStatusInfoClass *);
 /* Initialise une instance de la barre de statut pour l'éditeur. */
 static void g_status_info_init(GStatusInfo *);
 
+/* Supprime toutes les références externes. */
+static void g_status_info_dispose(GStatusInfo *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_status_info_finalize(GStatusInfo *);
+
 /* Lance une actualisation du fait d'un changement de vue. */
 static void update_status_info_for_view(GStatusInfo *, GtkViewPanel *);
 
@@ -91,6 +97,17 @@ G_DEFINE_TYPE(GStatusInfo, g_status_info, G_TYPE_EDITOR_ITEM);
 
 static void g_status_info_class_init(GStatusInfoClass *klass)
 {
+    GObjectClass *object;                   /* Autre version de la classe  */
+    GEditorItemClass *editem;               /* Encore une autre vision...  */
+
+    object = G_OBJECT_CLASS(klass);
+
+    object->dispose = (GObjectFinalizeFunc/* ! */)g_status_info_dispose;
+    object->finalize = (GObjectFinalizeFunc)g_status_info_finalize;
+
+    editem = G_EDITOR_ITEM_CLASS(klass);
+
+    editem->update_view = (update_item_view_fc)update_status_info_for_view;
 
 }
 
@@ -118,7 +135,51 @@ static void g_status_info_init(GStatusInfo *bar)
     item->widget = gtk_extended_status_bar_new();
     gtk_widget_show(item->widget);
 
-    item->update_view = (update_item_view_fc)update_status_info_for_view;
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : info = instance d'objet GLib à traiter.                      *
+*                                                                             *
+*  Description : Supprime toutes les références externes.                     *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_status_info_dispose(GStatusInfo *info)
+{
+    if (info->caret_instance != NULL)
+    {
+        g_signal_handlers_disconnect_by_func(info->caret_instance,
+                                             G_CALLBACK(track_caret_address_on_buffer_views),
+                                             info);
+        g_object_unref(info->caret_instance);
+    }
+
+    G_OBJECT_CLASS(g_status_info_parent_class)->dispose(G_OBJECT(info));
+
+}
+
+
+/******************************************************************************
+*                                                                             *
+*  Paramètres  : info = instance d'objet GLib à traiter.                      *
+*                                                                             *
+*  Description : Procède à la libération totale de la mémoire.                *
+*                                                                             *
+*  Retour      : -                                                            *
+*                                                                             *
+*  Remarques   : -                                                            *
+*                                                                             *
+******************************************************************************/
+
+static void g_status_info_finalize(GStatusInfo *info)
+{
+    G_OBJECT_CLASS(g_status_info_parent_class)->finalize(G_OBJECT(info));
 
 }
 
diff --git a/src/gui/tb/portions.c b/src/gui/tb/portions.c
index 432f808..bbc31b9 100644
--- a/src/gui/tb/portions.c
+++ b/src/gui/tb/portions.c
@@ -131,7 +131,8 @@ GEditorItem *create_portions_tb_item(GObject *ref)
 
     result = g_toolbar_item_new(ref, "portions", widget, _("Portions"));
 
-    result->update_binary = update_portions_item_binary;
+    /* FIXME */
+    //G_EDITOR_ITEM_GET_CLASS(result)->update_binary = update_portions_item_binary;
 
     return result;
 
diff --git a/src/gui/tb/source.c b/src/gui/tb/source.c
index d5318c4..74de77e 100644
--- a/src/gui/tb/source.c
+++ b/src/gui/tb/source.c
@@ -115,8 +115,9 @@ GEditorItem *create_source_tb_item(GObject *ref)
 
     result = g_toolbar_item_new(ref, "source", widget, _("Source files"));
 
-    result->update_binary = update_source_item_binary;
-    result->update_view = update_source_item_view;
+    /* FIXME */
+    //G_EDITOR_ITEM_GET_CLASS(result)->update_binary = update_source_item_binary;
+    //G_EDITOR_ITEM_GET_CLASS(result)->update_view = update_source_item_view;
 
     return result;
 
-- 
cgit v0.11.2-87-g4458