Open qqiangwu opened 7 months ago
void DeleteRecoveredTransaction(const std::string& name) { auto it = recovered_transactions_.find(name); assert(it != recovered_transactions_.end()); auto* trx = it->second; recovered_transactions_.erase(it); for (const auto& info : trx->batches_) { logs_with_prep_tracker_.MarkLogAsHavingPrepSectionFlushed( info.second.log_number_); } delete trx; }
got:
/Users/wuqq/dev/rocksdb-main/db/db_impl/db_impl.h:1045:27: warning: dereferencing a dangling pointer 1045 | for (const auto& info : trx->batches_) { | ^ /Users/wuqq/dev/rocksdb-main/db/db_impl/db_impl.h:1044:35: note: modified here 1044 | recovered_transactions_.erase(it); | ^~
got: