From 429490bd78fb7a842c8d654b11e6786777910c85 Mon Sep 17 00:00:00 2001 From: antao Date: Sun, 24 Feb 2019 09:55:26 +0800 Subject: [PATCH] Modify DbClientImpl --- orm_lib/src/DbClientImpl.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/orm_lib/src/DbClientImpl.cc b/orm_lib/src/DbClientImpl.cc index 8dccbfaa..d47355d9 100644 --- a/orm_lib/src/DbClientImpl.cc +++ b/orm_lib/src/DbClientImpl.cc @@ -127,9 +127,13 @@ void DbClientImpl::execSql(const DbConnectionPtr &conn, } return; } - std::weak_ptr weakConn = conn; - conn->execSql(std::move(sql), paraNum, std::move(parameters), std::move(length), std::move(format), - std::move(rcb), std::move(exceptCallback)); + conn->execSql(std::move(sql), + paraNum, + std::move(parameters), + std::move(length), + std::move(format), + std::move(rcb), + std::move(exceptCallback)); } void DbClientImpl::execSql(std::string &&sql, size_t paraNum, @@ -245,7 +249,7 @@ std::shared_ptr DbClientImpl::newTransaction(const std::functionloop()->queueInLoop([weakThis, conn]() { auto thisPtr = weakThis.lock(); - if(!thisPtr) + if (!thisPtr) return; std::weak_ptr weakConn = conn; conn->setIdleCallback([weakThis, weakConn]() {