summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/menus/edition.c11
-rw-r--r--src/gui/panels/strings.c7
-rw-r--r--src/gui/status.c2
3 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c
index 95b4f50..da2c60f 100644
--- a/src/gui/menus/edition.c
+++ b/src/gui/menus/edition.c
@@ -384,6 +384,8 @@ static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, GMenuBar *
switcher = g_db_switcher_new(instr, G_IMM_OPERAND(creator), display);
+ g_object_unref(G_OBJECT(instr));
+
g_loaded_binary_add_to_collection(binary, G_DB_ITEM(switcher));
g_object_unref(G_OBJECT(proc));
@@ -492,7 +494,6 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
const mrange_t *range; /* Couverture en mémoire */
GLoadedBinary *binary; /* Représentation binaire */
GArchProcessor *proc; /* Processeur de l'architecture*/
- GArchInstruction *list; /* Ensemble des instructions */
GArchInstruction *instr; /* Point de croisements */
GObject *ref; /* Espace de référencements */
GtkWidget *dialog; /* Boîte de dialogue à montrer */
@@ -506,7 +507,6 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar));
proc = g_loaded_binary_get_processor(binary);
- list = g_arch_processor_get_disassembled_instructions(proc);
/**
* On ne peut pas se reposer sur l'espace couvert par une ligne, car il peut
@@ -518,9 +518,9 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
*
* instr = g_arch_instruction_find_by_range(list, range);
*
- * Il faut ainsi être plus souple.
+ * Il faut ainsi être plus souple, et se baser sur l'adresse uniquement.
*/
- instr = g_arch_instruction_find_by_address(list, get_mrange_addr(range), true);
+ instr = g_arch_processor_find_instr_by_address(proc, get_mrange_addr(range));
ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar));
@@ -538,6 +538,9 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar)
gtk_widget_destroy(dialog);
+ if (instr != NULL)
+ g_object_unref(G_OBJECT(instr));
+
g_object_unref(G_OBJECT(proc));
g_object_unref(G_OBJECT(line));
diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c
index 4f919b1..b8631b6 100644
--- a/src/gui/panels/strings.c
+++ b/src/gui/panels/strings.c
@@ -1030,7 +1030,6 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
const mrange_t *range; /* Couverture en mémoire */
GLoadedBinary *binary; /* Représentation binaire */
GArchProcessor *proc; /* Processeur de l'architecture*/
- GArchInstruction *list; /* Ensemble des instructions */
GArchInstruction *instr; /* Point de croisements */
GObject *ref; /* Espace de référencements */
GtkWidget *dialog; /* Boîte de dialogue à montrer */
@@ -1044,13 +1043,12 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(panel));
proc = g_loaded_binary_get_processor(binary);
- list = g_arch_processor_get_disassembled_instructions(proc);
/**
* Se rapporter aux commentaires de mcb_edition_list_xrefs() pour les questions
* concernant l'usage d'une adresse d'instruction au lieu de son emplacement.
*/
- instr = g_arch_instruction_find_by_address(list, get_mrange_addr(range), true);
+ instr = g_arch_processor_find_instr_by_address(proc, get_mrange_addr(range));
ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(panel));
@@ -1069,6 +1067,9 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa
gtk_widget_destroy(dialog);
+ if (instr != NULL)
+ g_object_unref(G_OBJECT(instr));
+
g_object_unref(G_OBJECT(proc));
g_object_unref(G_OBJECT(symbol));
diff --git a/src/gui/status.c b/src/gui/status.c
index b6e8fe6..fc8eafd 100644
--- a/src/gui/status.c
+++ b/src/gui/status.c
@@ -269,6 +269,8 @@ static void focus_address_in_status_info(GStatusInfo *info, GLoadedBinary *binar
gtk_status_stack_update_current_instruction(GTK_STATUS_STACK(item->widget), binary, instr);
+ g_object_unref(G_OBJECT(instr));
+
g_object_unref(G_OBJECT(proc));
}