summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-01-27 13:57:34 +0200
committerTor Lillqvist <tlillqvist@novell.com>2011-01-27 14:03:50 +0200
commit9f06603d3234bf8b45a71f42f47c1393bf60f278 (patch)
tree9a0ba9a518aa23efa02f81d640ebdf19eaddb8a2 /unotools
parentc9ce931cee63f2378e690fa87ed3e1d10d1f3909 (diff)
Do potentially pointless assertions only if dbglevel > 1
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configitem.cxx5
-rw-r--r--unotools/source/config/configmgr.cxx5
2 files changed, 10 insertions, 0 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index 3277963e8edf..dc0fabfd298d 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -1324,7 +1324,12 @@ Reference< XHierarchicalNameAccess> ConfigItem::GetTree()
xRet = pImpl->pManager->AcquireTree(*this);
else
xRet = m_xHierarchyAccess;
+#if OSL_DEBUG_LEVEL > 1
+ // I think this is a pointless assertion, the callers seem to cope
+ // fine with returning an invalid reference, no need to crash in a
+ // dbglevel=1 build.
OSL_ENSURE(xRet.is(), "AcquireTree failed");
+#endif
return xRet;
}
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 87c7b6259d63..16606c346985 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -116,7 +116,12 @@ ConfigManager::ConfigManager(Reference< XMultiServiceFactory > xConfigProv) :
ConfigManager::~ConfigManager()
{
//check list content -> should be empty!
+#if OSL_DEBUG_LEVEL > 1
+ // I think this is a pointless assertion, the code seems to cope
+ // fine with it being empty, no need to crash in a dbglevel=1
+ // build.
OSL_ENSURE(pMgrImpl->aItemList.empty(), "some ConfigItems are still alive");
+#endif
if(!pMgrImpl->aItemList.empty())
{
ConfigItemList::iterator aListIter;