summaryrefslogtreecommitdiff
path: root/src/gui/menus
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/menus
parentafc9e5510d9520928480042a56a193dd71db6a01 (diff)
Referenced all accesses to the main window.
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/binary.c28
-rw-r--r--src/gui/menus/file.c16
2 files changed, 38 insertions, 6 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c
index 3a143da..cb131d7 100644
--- a/src/gui/menus/binary.c
+++ b/src/gui/menus/binary.c
@@ -212,13 +212,16 @@ void update_access_for_view_in_menu_binary(GLoadedPanel *new)
static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar)
{
GLoadedBinary *binary; /* Binaire présenté à l'écran */
+ GtkWindow *editor; /* Fenêtre graphique principale*/
GtkWidget *dialog; /* Boîte de dialogue à montrer */
vmpa2t *addr; /* Adresse de destination */
GLoadedPanel *panel; /* Afficheur effectif de code */
binary = G_LOADED_BINARY(get_current_content());
- dialog = create_gotox_dialog_for_entry_points(get_editor_window(), binary);
+ editor = get_editor_window();
+
+ dialog = create_gotox_dialog_for_entry_points(editor, binary);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
{
@@ -237,6 +240,8 @@ static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar)
gtk_widget_destroy(dialog);
+ g_object_unref(G_OBJECT(editor));
+
g_object_unref(G_OBJECT(binary));
}
@@ -278,12 +283,15 @@ static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar)
{
GLoadedBinary *binary; /* Edition courante */
GtkBuilder *builder; /* Constructeur utilisé */
+ GtkWindow *editor; /* Fenêtre graphique principale*/
GtkWidget *dialog; /* Boîte de dialogue à montrer */
gint ret; /* Retour de confirmation */
binary = G_LOADED_BINARY(get_current_content());
- dialog = create_storage_dialog(binary, get_editor_window(), &builder);
+ editor = get_editor_window();
+
+ dialog = create_storage_dialog(binary, editor, &builder);
ret = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -294,6 +302,8 @@ static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar)
g_object_unref(G_OBJECT(builder));
+ g_object_unref(G_OBJECT(editor));
+
g_object_unref(G_OBJECT(binary));
}
@@ -315,10 +325,15 @@ static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar)
static void mcb_binary_export_disass(GtkMenuItem *menuitem, gpointer unused)
{
GLoadedBinary *binary; /* Edition courante */
+ GtkWindow *editor; /* Fenêtre graphique principale*/
binary = G_LOADED_BINARY(get_current_content());
- run_export_assistant(binary, get_editor_window());
+ editor = get_editor_window();
+
+ run_export_assistant(binary, editor);
+
+ g_object_unref(G_OBJECT(editor));
g_object_unref(G_OBJECT(binary));
@@ -342,12 +357,17 @@ static void mcb_binary_export_graph(GtkMenuItem *menuitem, gpointer unused)
{
GtkGraphDisplay *panel; /* Panneau de code courant */
GLoadedBinary *binary; /* Edition courante */
+ GtkWindow *editor; /* Fenêtre graphique principale*/
binary = G_LOADED_BINARY(get_current_content());
panel = GTK_GRAPH_DISPLAY(get_current_view());
- run_graph_export_assistant(binary, panel, get_editor_window());
+ editor = get_editor_window();
+
+ run_graph_export_assistant(binary, panel, editor);
+
+ g_object_unref(G_OBJECT(editor));
g_object_unref(G_OBJECT(panel));
diff --git a/src/gui/menus/file.c b/src/gui/menus/file.c
index 469aa41..3008635 100644
--- a/src/gui/menus/file.c
+++ b/src/gui/menus/file.c
@@ -164,11 +164,14 @@ static void mcb_file_new_project(GtkMenuItem *menuitem, gpointer unused)
static void mcb_file_open_project(GtkMenuItem *menuitem, gpointer unused)
{
+ GtkWindow *editor; /* Fenêtre graphique principale*/
GtkWidget *dialog; /* Boîte à afficher */
GStudyProject *project; /* Projet chargé */
gchar *filename; /* Nom du fichier à intégrer */
- dialog = gtk_file_chooser_dialog_new(_("Open a project"), get_editor_window(),
+ editor = get_editor_window();
+
+ dialog = gtk_file_chooser_dialog_new(_("Open a project"), editor,
GTK_FILE_CHOOSER_ACTION_OPEN,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_ACCEPT,
@@ -200,6 +203,8 @@ static void mcb_file_open_project(GtkMenuItem *menuitem, gpointer unused)
gtk_widget_destroy(dialog);
+ g_object_unref(G_OBJECT(editor));
+
}
@@ -251,11 +256,14 @@ void mcb_file_save_project(GtkMenuItem *menuitem, gpointer unused)
static void mcb_file_save_project_as(GtkMenuItem *menuitem, gpointer unused)
{
+ GtkWindow *editor; /* Fenêtre graphique principale*/
GtkWidget *dialog; /* Boîte à afficher */
GStudyProject *project; /* Projet courant */
gchar *filename; /* Nom du fichier à intégrer */
- dialog = gtk_file_chooser_dialog_new(_("Save the project as..."), get_editor_window(),
+ editor = get_editor_window();
+
+ dialog = gtk_file_chooser_dialog_new(_("Save the project as..."), editor,
GTK_FILE_CHOOSER_ACTION_SAVE,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Save"), GTK_RESPONSE_ACCEPT,
@@ -282,6 +290,8 @@ static void mcb_file_save_project_as(GtkMenuItem *menuitem, gpointer unused)
gtk_widget_destroy(dialog);
+ g_object_unref(G_OBJECT(editor));
+
}
@@ -306,4 +316,6 @@ static void mcb_file_quit(GtkMenuItem *menuitem, gpointer unused)
gtk_window_close(editor);
+ g_object_unref(G_OBJECT(editor));
+
}