summaryrefslogtreecommitdiff
path: root/plugins/ropgadgets
diff options
context:
space:
mode:
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));
}