diff --git a/td/telegram/TdDb.cpp b/td/telegram/TdDb.cpp index b79a2d9cf..39fe13dd3 100644 --- a/td/telegram/TdDb.cpp +++ b/td/telegram/TdDb.cpp @@ -163,8 +163,8 @@ std::shared_ptr TdDb::get_config_pmc_shared() { return config_pmc_; } -KeyValueSyncInterface *TdDb::get_binlog_pmc() { - CHECK(binlog_pmc_); +KeyValueSyncInterface *TdDb::get_binlog_pmc_impl(const char *file, int line) { + LOG_CHECK(binlog_pmc_) << G()->close_flag() << ' ' << file << ' ' << line; return binlog_pmc_.get(); } diff --git a/td/telegram/TdDb.h b/td/telegram/TdDb.h index f249f2cc5..a9e83fe60 100644 --- a/td/telegram/TdDb.h +++ b/td/telegram/TdDb.h @@ -76,7 +76,9 @@ class TdDb { std::shared_ptr get_binlog_pmc_shared(); std::shared_ptr get_config_pmc_shared(); - KeyValueSyncInterface *get_binlog_pmc(); + +#define get_binlog_pmc() get_binlog_pmc_impl(__FILE__, __LINE__) + KeyValueSyncInterface *get_binlog_pmc_impl(const char *file, int line); KeyValueSyncInterface *get_config_pmc(); SqliteKeyValue *get_sqlite_sync_pmc();