/* Current folder was unselected */
if (priv->cur_folder_store) {
- g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0,
- priv->cur_folder_store, FALSE);
-
+ /* We must do this firstly because a libtinymail-camel
+ implementation detail. If we issue the signal
+ before doing the sync_async, then that signal could
+ cause (and it actually does it) a free of the
+ summary of the folder (because the main window will
+ clear the headers view */
if (TNY_IS_FOLDER(priv->cur_folder_store))
tny_folder_sync_async (TNY_FOLDER(priv->cur_folder_store),
FALSE, NULL, NULL, NULL);
- /* FALSE --> don't expunge the messages */
+ g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0,
+ priv->cur_folder_store, FALSE);
g_object_unref (priv->cur_folder_store);
priv->cur_folder_store = NULL;
}
if (priv->folder) {
- if (priv->status_timeout)
+ if (priv->status_timeout) {
g_source_remove (priv->status_timeout);
+ priv->status_timeout = 0;
+ }
g_mutex_lock (priv->observers_lock);
tny_folder_remove_observer (priv->folder, TNY_FOLDER_OBSERVER (self));
notify_filter_change_destroy (gpointer data)
{
NotifyFilterInfo *info = (NotifyFilterInfo *) data;
+ ModestHeaderViewPrivate *priv;
+
+ priv = MODEST_HEADER_VIEW_GET_PRIVATE (info->self);
+ priv->status_timeout = 0;
g_object_unref (info->self);
g_object_unref (info->folder);