summaryrefslogtreecommitdiff
path: root/plugins/ropgadgets
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 /plugins/ropgadgets
parentafc9e5510d9520928480042a56a193dd71db6a01 (diff)
Referenced all accesses to the main window.
Diffstat (limited to 'plugins/ropgadgets')
-rw-r--r--plugins/ropgadgets/plugin.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/plugins/ropgadgets/plugin.c b/plugins/ropgadgets/plugin.c
index 1e8aef6..e1d29b0 100644
--- a/plugins/ropgadgets/plugin.c
+++ b/plugins/ropgadgets/plugin.c
@@ -68,21 +68,32 @@ static void mcb_plugins_list_rop_gadgets(GtkMenuItem *, gpointer);
G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin)
{
+ bool result; /* Bilan à retourner */
GObject *ref; /* Espace de référencements */
GtkContainer *menubar; /* Support pour éléments */
GtkWidget *submenuitem; /* Sous-élément de menu */
+ result = false;
+
ref = G_OBJECT(get_editor_window());
- if (ref == NULL) return false;
+ if (ref == NULL) goto no_editor;
menubar = GTK_CONTAINER(g_object_get_data(ref, "menubar_plugins"));
- if (menubar == NULL) return false;
+ if (menubar == NULL) goto no_menubar;
submenuitem = qck_create_menu_item(ref, "mnu_plugins_ropgadgets", _("List ROP gadgets"),
G_CALLBACK(mcb_plugins_list_rop_gadgets), NULL);
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
- return true;
+ result = true;
+
+ no_menubar:
+
+ g_object_unref(ref);
+
+ no_editor:
+
+ return result;
}
@@ -102,6 +113,12 @@ G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin)
static void mcb_plugins_list_rop_gadgets(GtkMenuItem *menuitem, gpointer unused)
{
- run_rop_finder_assistant(get_editor_window());
+ GtkWindow *editor; /* Fenêtre graphique principale*/
+
+ editor = get_editor_window();
+
+ run_rop_finder_assistant(editor);
+
+ g_object_unref(G_OBJECT(editor));
}