diff --git a/src/observer/storage/trx/mvcc_trx.cpp b/src/observer/storage/trx/mvcc_trx.cpp index 031a4d01d13e25edad87967d5749fe5674c81c46..4488dcc5ef0ecff14b70705c4d76969c2be1dfc6 100644 --- a/src/observer/storage/trx/mvcc_trx.cpp +++ b/src/observer/storage/trx/mvcc_trx.cpp @@ -85,7 +85,12 @@ Trx *MvccTrxKit::create_trx(int32_t trx_id) void MvccTrxKit::destroy_trx(Trx *trx) { lock_.lock(); - erase(trxes_, trx); + for (auto iter = trxes_.begin(), itend = trxes_.end(); iter != itend; ++iter) { + if (*iter == trx) { + trxes_.erase(iter); + break; + } + } lock_.unlock(); delete trx;