diff --git a/src/dsql/DsqlStatements.cpp b/src/dsql/DsqlStatements.cpp index 47117b26a6..c72f38fd95 100644 --- a/src/dsql/DsqlStatements.cpp +++ b/src/dsql/DsqlStatements.cpp @@ -56,17 +56,15 @@ void DsqlStatement::rethrowDdlException(status_exception& ex, bool metadataUpdat status_exception::raise(newVector); } -int DsqlStatement::release() +void DsqlStatement::release() { fb_assert(refCounter.value() > 0); - int refCnt = --refCounter; - if (!refCnt) + if (!--refCounter) { if (cacheKey) { dsqlAttachment->dbb_statement_cache->statementGoingInactive(cacheKey); - refCnt = refCounter; } else { @@ -74,8 +72,6 @@ int DsqlStatement::release() dsqlAttachment->deletePool(&getPool()); } } - - return refCnt; } void DsqlStatement::doRelease() diff --git a/src/dsql/DsqlStatements.h b/src/dsql/DsqlStatements.h index 1ab48fc986..399852bf63 100644 --- a/src/dsql/DsqlStatements.h +++ b/src/dsql/DsqlStatements.h @@ -83,12 +83,12 @@ protected: virtual ~DsqlStatement() = default; public: - int addRef() + void addRef() { - return ++refCounter; + ++refCounter; } - int release(); + void release(); bool isCursorBased() const {