aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-01-24 19:33:01 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-01-24 19:33:01 +0800
commit4ed20e6ba0afa83a20cc12da9f2385c34b1931ff (patch)
tree59acb29ac733cae047f80c9fe3530096893a1d69 /mail
parent32dc71eaec1260020454061a80ba83cc5a1e2aa4 (diff)
downloadgsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.tar
gsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.tar.gz
gsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.tar.bz2
gsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.tar.lz
gsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.tar.xz
gsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.tar.zst
gsoc2013-evolution-4ed20e6ba0afa83a20cc12da9f2385c34b1931ff.zip
** Fix for bug #402487
2008-01-24 Milan Crha <mcrha@redhat.com> ** Fix for bug #402487 * calendar/gui/cal-search-bar.c: (notify_e_cal_view_contains): * mail/em-folder-browser.c: (emfb_search_search_activated), (generate_viewoption_menu): * widgets/misc/e-search-bar.c: (search_now_verb_cb), (scopeoption_changed_cb): Memory leak fix. svn path=/trunk/; revision=34880
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-folder-browser.c26
2 files changed, 30 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3c1d1685c4..c7006a72ea 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,12 @@
2008-01-24 Milan Crha <mcrha@redhat.com>
+ ** Fix for bug #402487
+
+ * em-folder-browser.c: (emfb_search_search_activated),
+ (generate_viewoption_menu): Memory leak fix.
+
+2008-01-24 Milan Crha <mcrha@redhat.com>
+
** Part of bug #511488
* mail-vfolder.h:
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 0ef7be078b..83c905d928 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -336,8 +336,9 @@ generate_viewoption_menu (GtkWidget *emfv)
g_object_set_data (G_OBJECT (menu_item), "EsbItemId",
GINT_TO_POINTER (VIEW_LABEL + (VIEW_ITEMS_MASK + 1) * i));
- g_object_set_data (G_OBJECT (menu_item), "LabelTag",
- g_strdup (strncmp (label->tag, "$Label", 6) == 0 ? label->tag + 6 : label->tag));
+ g_object_set_data_full (G_OBJECT (menu_item), "LabelTag",
+ g_strdup (strncmp (label->tag, "$Label", 6) == 0 ? label->tag + 6 : label->tag),
+ g_free);
}
gtk_widget_show (menu_item);
@@ -1033,7 +1034,7 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
{
EMFolderView *emfv = (EMFolderView *) emfb;
EFilterBar *efb = (EFilterBar *)esb;
- char *search_state, *view_sexp, *folder_uri=NULL;
+ char *search_state = NULL, *view_sexp, *folder_uri=NULL;
char *word = NULL, *storeuri = NULL, *search_word = NULL;
gint id, i;
CamelFolder *folder;
@@ -1058,6 +1059,7 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
} else {
em_format_html_display_search_close (emfb->view.preview);
}
+ g_free (word);
return;
break;
@@ -1075,9 +1077,13 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
}
g_signal_emit (emfb, folder_browser_signals [ACCOUNT_SEARCH_CLEARED], 0);
gtk_widget_set_sensitive (esb->scopeoption, TRUE);
+ g_free (word);
+ word = NULL;
break;
}
+ g_free (word);
+ word = NULL;
g_object_get (esb, "query", &search_word, NULL);
if (efb->account_search_vf && !strcmp (search_word, ((CamelVeeFolder *) efb->account_search_vf)->expression) ) {
break;
@@ -1127,9 +1133,14 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
}
g_signal_emit (emfb, folder_browser_signals [ACCOUNT_SEARCH_CLEARED], 0);
gtk_widget_set_sensitive (esb->scopeoption, TRUE);
+ g_free (word);
+ word = NULL;
break;
}
+ g_free (word);
+ word = NULL;
+
g_object_get (esb, "query", &search_word, NULL);
if (search_word && efb->all_account_search_vf && !strcmp (search_word, ((CamelVeeFolder *) efb->all_account_search_vf)->expression) ) {
@@ -1192,11 +1203,19 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
g_object_get (esb, "state", &search_state, NULL);
camel_object_meta_set (emfv->folder, "evolution:search_state", search_state);
camel_object_state_write (emfv->folder);
+ g_free (search_state);
+
+ if (search_word) {
+ g_free (search_word);
+ search_word = NULL;
+ }
/* Merge the view and search expresion*/
view_sexp = get_view_query (esb, emfv->folder, emfv->folder_uri);
g_object_get (esb, "query", &search_word, NULL);
+ word = search_word;
+
if (search_word && *search_word)
search_word = g_strconcat ("(and ", view_sexp, search_word, " )", NULL);
else
@@ -1204,6 +1223,7 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
message_list_set_search(emfb->view.list, search_word);
+ g_free (word);
g_free (search_word);
g_free (view_sexp);