/* 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;