[Libreoffice-commits] core.git: include/salhelper
Noel Grandin
noel at peralex.com
Wed Jun 8 07:33:11 UTC 2016
include/salhelper/dynload.hxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 4bdbfdd6426460c562746c67c29a3b5e2bef8563
Author: Noel Grandin <noel at peralex.com>
Date: Wed Jun 8 08:45:52 2016 +0200
fix release in ODynamicLoader
otherwise, if the refcount goes to zero, we delete the object,
and the static pointer is now pointing to freed memory.
Change-Id: I0cdd303590e4e70797bfddb8b403db4d831aab04
Reviewed-on: https://gerrit.libreoffice.org/26045
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
Tested-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/salhelper/dynload.hxx b/include/salhelper/dynload.hxx
index b5b16fa..e157c01 100644
--- a/include/salhelper/dynload.hxx
+++ b/include/salhelper/dynload.hxx
@@ -147,7 +147,8 @@ public:
~ODynamicLoader()
{
if( m_pLoader )
- m_pLoader->release();
+ if (m_pLoader->release()==0)
+ m_pStaticLoader = nullptr;
}
/// Assign operator
@@ -175,7 +176,7 @@ public:
return static_cast<API*>(m_pLoader->getApi());
}
- /// cast operator, which cast to a poiner with the initialized API function structure.
+ /// cast operator, which cast to a pointer with the initialized API function structure.
API* SAL_CALL operator->() const
{
return static_cast<API*>(m_pLoader->getApi());
More information about the Libreoffice-commits
mailing list