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 e1c137a commit 25f43ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/dialog/dlg_replication.c
Expand Up @@ -1110,13 +1110,15 @@ struct dlg_cell *drop_dlg(struct dlg_cell *dlg, int i)
unref++;

if (dlg_db_mode != DB_MODE_NONE) {
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++;
}

Expand Down

0 comments on commit 25f43ca

Please sign in to comment.