浏览代码

dialog: fix initialization of slot next_id to avoid colision after restart

- next_id was set to the highest id of a dialog loaded from database,
  next new dialog was reusing the same value
mikomarrache 10 年之前
父节点
当前提交
e122c5ee8c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/dialog/dlg_db_handler.c

+ 1 - 1
modules/dialog/dlg_db_handler.c

@@ -366,7 +366,7 @@ static int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows)
 			next_id = d_table->entries[dlg->h_entry].next_id;
 
 			d_table->entries[dlg->h_entry].next_id =
-				(next_id < dlg->h_id) ? (dlg->h_id+1) : next_id;
+				(next_id <= dlg->h_id) ? (dlg->h_id+1) : next_id;
 
 			GET_STR_VALUE(to_tag, values, 6, 1, 1);