After the message has been deleted, summary_show() will
redisplay the folder and free all the MsgInfos, but we still
need the one for the message currently displayed in our
messageview window, so we add our own reference to it, and free
it ourselves when we're done.
This was only happening when summaryview already has a different
message displayed.
Fixes bug #4029: segfault after deleting message in a window
cm_return_if_fail(msginfo != NULL);
+ /* We will need to access the original message's msginfo
+ * later, so we add our own reference. */
+ procmsg_msginfo_new_ref(msginfo);
+
/* to get the trash folder, we have to choose either
* the folder's or account's trash default - we prefer
* the one in the account prefs */
procmsg_msginfo_set_flags(msginfo, MSG_DELETED, 0);
/* NOTE: does not update to next message in summaryview */
}
+
+ procmsg_msginfo_free(&msginfo);
}
#ifdef GENERIC_UMPC
if (msgview->window && !prefs_common.always_show_msg) {