Skip to content

Commit fb73370

Browse files
committed
elemintion of compile warnings
found memory leak in nemo-places-sidebar.c in nemo_places_sidebar_dispose
1 parent f2ee707 commit fb73370

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

libnemo-private/nemo-action.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,11 +1431,7 @@ get_insertion_string (NemoAction *action,
14311431
break;
14321432
}
14331433

1434-
gchar *ret = str->str;
1435-
1436-
g_string_free (str, FALSE);
1437-
1438-
return ret;
1434+
return g_string_free (str, FALSE);
14391435
}
14401436

14411437
static GString *
@@ -1591,9 +1587,7 @@ get_final_label (NemoAction *action,
15911587

15921588
DEBUG ("Action Label: %s", str->str);
15931589

1594-
gchar *ret = str->str;
1595-
g_string_free (str, FALSE);
1596-
return ret;
1590+
return g_string_free (str, FALSE);
15971591
}
15981592

15991593
static gchar *
@@ -1616,9 +1610,7 @@ get_final_tt (NemoAction *action,
16161610

16171611
DEBUG ("Action Tooltip: %s", str->str);
16181612

1619-
gchar *ret = str->str;
1620-
g_string_free (str, FALSE);
1621-
return ret;
1613+
return g_string_free (str, FALSE);
16221614
}
16231615

16241616
static void

libnemo-private/nemo-search-engine-advanced.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,9 @@ load_contents (SearchThreadData *data,
770770
break;
771771
}
772772

773-
if (chunk != NULL) {
773+
//if (chunk != NULL) {
774774
g_string_append_len (str, chunk, len);
775-
}
775+
//}
776776
} while (!g_cancellable_is_cancelled (data->cancellable));
777777

778778
g_input_stream_close (stream,

search-helpers/nemo-mso-to-txt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ process_file (GString *collective,
6161

6262
gsf_input_read (GSF_INPUT (file), size, chunk);
6363

64-
if (chunk != NULL)
64+
// if (chunk != NULL) always true
6565
{
6666
remaining -= size;
6767
contents = g_string_append_len (contents, (const gchar *) chunk, size);

src/nemo-places-sidebar.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4399,6 +4399,9 @@ nemo_places_sidebar_dispose (GObject *object)
43994399
g_free (sidebar->uri);
44004400
sidebar->uri = NULL;
44014401

4402+
g_clear_object (&sidebar->ui_manager);
4403+
sidebar->ui_manager = NULL;
4404+
44024405
free_drag_data (sidebar);
44034406

44044407
g_clear_handle_id (&sidebar->actions_changed_idle_id, g_source_remove);
@@ -4437,11 +4440,15 @@ nemo_places_sidebar_dispose (GObject *object)
44374440
breakpoint_changed_cb,
44384441
sidebar);
44394442

4443+
g_signal_handlers_disconnect_by_func (nemo_preferences,
4444+
reset_menu,
4445+
sidebar);
4446+
44404447
g_signal_handlers_disconnect_by_func (nemo_preferences,
44414448
desktop_setting_changed_callback,
44424449
sidebar);
44434450

4444-
g_signal_handlers_disconnect_by_func (gnome_background_preferences,
4451+
g_signal_handlers_disconnect_by_func (nemo_desktop_preferences,
44454452
desktop_setting_changed_callback,
44464453
sidebar);
44474454

src/nemo-properties-window.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4719,7 +4719,6 @@ get_pending_key (GList *file_list)
47194719
GList *l;
47204720
GList *uris;
47214721
GString *key;
4722-
char *ret;
47234722

47244723
uris = NULL;
47254724
for (l = file_list; l != NULL; l = l->next) {
@@ -4735,10 +4734,7 @@ get_pending_key (GList *file_list)
47354734

47364735
g_list_free_full (uris, g_free);
47374736

4738-
ret = key->str;
4739-
g_string_free (key, FALSE);
4740-
4741-
return ret;
4737+
return g_string_free (key, FALSE);
47424738
}
47434739

47444740
static StartupData *

0 commit comments

Comments
 (0)