Skip to content

Commit

Permalink
dialog: fix crash when dropping unsynced dialogs
Browse files Browse the repository at this point in the history
(cherry picked from commit da47168)
  • Loading branch information
rvlad-patrascu committed Jan 28, 2022
1 parent 8d0e21f commit 122c1e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/dialog/dlg_replication.c
Expand Up @@ -1114,13 +1114,15 @@ void rcv_cluster_event(enum clusterer_event ev, int node_id)
/* successfully removed from timer list */
unref++;

if (dlg_db_mode != DB_MODE_SHUTDOWN) {
if (dlg_db_mode != DB_MODE_SHUTDOWN &&
!(dlg->flags&DLG_FLAG_DB_DELETED)) {
dlg->flags &= ~DLG_FLAG_NEW;
remove_dialog_from_db(dlg);
dlg->flags |= DLG_FLAG_DB_DELETED;
}

if (dlg_db_mode == DB_MODE_DELAYED)
if (dlg_db_mode == DB_MODE_DELAYED &&
!(dlg->flags&DLG_FLAG_DB_DELETED))
unref++;

if (old_state != DLG_STATE_DELETED)
Expand Down

0 comments on commit 122c1e3

Please sign in to comment.