Skip to content

Commit 5315214

Browse files
committed
feat postgresql: more robust dtr
commit_hash:431858001600f9683c617316311ad08d30b722e2
1 parent 9c6aae6 commit 5315214

File tree

1 file changed

+7
-0
lines changed
  • postgresql/src/storages/postgres/detail

1 file changed

+7
-0
lines changed

postgresql/src/storages/postgres/detail/pool.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,14 @@ void ConnectionPool::Clear() {
590590
while (conn_consumer_.PopNoblock(connection)) {
591591
delete connection;
592592
}
593+
594+
// A close task may still call Push(),
595+
// so cleanup queue after the task storage
593596
close_task_storage_.CancelAndWait();
597+
598+
queue_.reset();
599+
std::move(conn_consumer_).Reset();
600+
std::move(conn_producer_).Reset();
594601
}
595602

596603
void ConnectionPool::CleanupConnection(Connection* connection) {

0 commit comments

Comments
 (0)