summaryrefslogtreecommitdiff
path: root/src/gui/panels/symbols.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/panels/symbols.c')
-rw-r--r--src/gui/panels/symbols.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index 809fed8..2cb2b34 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -61,7 +61,7 @@ struct _GSymbolsPanel
GPanelItem parent; /* A laisser en premier */
GLoadedBinary *binary; /* Binaire à prendre en compte */
- const char *sep; /* Délimitateur à utiliser */
+ char *sep; /* Délimitateur à utiliser */
size_t count; /* Quantité de symboles utiles */
@@ -658,6 +658,12 @@ static void change_symbols_panel_current_content(GSymbolsPanel *panel, GLoadedCo
if (panel->binary != NULL)
g_object_unref(G_OBJECT(panel->binary));
+ if (panel->sep != NULL)
+ {
+ free(panel->sep);
+ panel->sep = NULL;
+ }
+
panel->binary = binary;
if (panel->binary != NULL)
@@ -676,11 +682,18 @@ static void change_symbols_panel_current_content(GSymbolsPanel *panel, GLoadedCo
if (binary != NULL)
{
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
+
demangler = g_binary_format_get_demangler(format);
- panel->sep = g_compiler_demangler_get_ns_separator(demangler);
+ if (demangler == NULL)
+ panel->sep = NULL;
+
+ else
+ {
+ panel->sep = strdup(g_compiler_demangler_get_ns_separator(demangler));
+ g_object_unref(G_OBJECT(demangler));
+ }
- g_object_unref(G_OBJECT(demangler));
g_object_unref(G_OBJECT(format));
if (panel->sep == NULL)