summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-06-24 19:16:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-06-24 19:16:23 (GMT)
commitd614d4b09230411455ed07aac289025a55633da8 (patch)
treec94a14097f9e97b21e5780852589d167ca68ba59 /src/gui/panels
parentafc9e5510d9520928480042a56a193dd71db6a01 (diff)
Referenced all accesses to the main window.
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/strings.c8
-rw-r--r--src/gui/panels/welcome.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c
index 7fd0ffc..a99b40c 100644
--- a/src/gui/panels/strings.c
+++ b/src/gui/panels/strings.c
@@ -1269,7 +1269,7 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
const mrange_t *range; /* Couverture en mémoire */
GArchProcessor *proc; /* Processeur de l'architecture*/
GArchInstruction *instr; /* Point de croisements */
- GObject *ref; /* Espace de référencements */
+ GtkWindow *editor; /* Fenêtre graphique principale*/
GtkWidget *dialog; /* Boîte de dialogue à montrer */
vmpa2t *addr; /* Adresse de destination */
GLoadedPanel *display; /* Afficheur effectif de code */
@@ -1287,9 +1287,9 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
*/
instr = g_arch_processor_find_instr_by_address(proc, get_mrange_addr(range));
- ref = G_OBJECT(get_editor_window());//g_editor_item_get_global_ref(G_EDITOR_ITEM(panel));
+ editor = get_editor_window();
- dialog = create_gotox_dialog_for_cross_references(GTK_WINDOW(ref), panel->binary, instr, true);
+ dialog = create_gotox_dialog_for_cross_references(editor, panel->binary, instr, true);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
{
@@ -1308,6 +1308,8 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
gtk_widget_destroy(dialog);
+ g_object_unref(G_OBJECT(editor));
+
if (instr != NULL)
g_object_unref(G_OBJECT(instr));
diff --git a/src/gui/panels/welcome.c b/src/gui/panels/welcome.c
index 6812125..63811a9 100644
--- a/src/gui/panels/welcome.c
+++ b/src/gui/panels/welcome.c
@@ -463,10 +463,12 @@ static void on_new_binary_clicked(GtkButton *button, GWelcomePanel *panel)
GObject *ref; /* Espace de référencements */
GtkMenuItem *item; /* Elément de menu simulé */
- ref = G_OBJECT(get_editor_window());//g_editor_item_get_global_ref(G_EDITOR_ITEM(panel));
+ ref = G_OBJECT(get_editor_window());
item = GTK_MENU_ITEM(g_object_get_data(ref, "mnu_project_add_binary"));
+ g_object_unref(ref);
+
gtk_menu_item_activate(item);
}