summaryrefslogtreecommitdiff
path: root/connectivity/source/parse/sqlnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/parse/sqlnode.cxx')
-rw-r--r--connectivity/source/parse/sqlnode.cxx28
1 files changed, 13 insertions, 15 deletions
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index b7464836e90b..b5a32548af1f 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1463,25 +1463,23 @@ OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >&
OSQLParser::~OSQLParser()
{
+ ::osl::MutexGuard aGuard(getMutex());
+ OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
+ if (!--s_nRefCount)
{
- ::osl::MutexGuard aGuard(getMutex());
- OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
- if (!--s_nRefCount)
- {
- s_pScanner->setScanner(true);
- delete s_pScanner;
- s_pScanner = nullptr;
+ s_pScanner->setScanner(true);
+ delete s_pScanner;
+ s_pScanner = nullptr;
- delete s_pGarbageCollector;
- s_pGarbageCollector = nullptr;
- // Is only set the first time, so we should delete it only when there are no more instances
- s_xLocaleData = nullptr;
+ delete s_pGarbageCollector;
+ s_pGarbageCollector = nullptr;
+ // Is only set the first time, so we should delete it only when there are no more instances
+ s_xLocaleData = nullptr;
- RuleIDMap aEmpty;
- s_aReverseRuleIDLookup.swap( aEmpty );
- }
- m_pParseTree = nullptr;
+ RuleIDMap aEmpty;
+ s_aReverseRuleIDLookup.swap( aEmpty );
}
+ m_pParseTree = nullptr;
}
void OSQLParseNode::substituteParameterNames(OSQLParseNode const * _pNode)