summaryrefslogtreecommitdiff
path: root/extensions/source/plugin/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-03-13 16:07:36 +0100
committerMichael Stahl <mstahl@redhat.com>2015-03-13 16:23:27 +0100
commit040cf119d184233971b9cbcc9c5478d9089f9157 (patch)
treeeda880f74425aec6b71e66c7dc8b0acd089fa17c /extensions/source/plugin/inc
parent077723111292ea615437f3bc2f1e47cf77d7ad42 (diff)
extensions: PVS-Studio V595 The 'm_pPlugin' pointer could be null
The plugin streams are a bit of a disaster area: there are 2 of them with a common base class and the PluginInputStream is a UNO service. The m_pPlugin gets reset in PluginStream::setMode(-1), which is called by the plugin itself. So those PluginStream/PluginInputStream methods that are called via UNO (including dtors) need to check that m_pPlugin isn't null, but they also lock member access with m_pPlugin's mutex. Try to ensure that that works by ensuring that the plugin is still alive with a WeakReference, *and* checking that m_pPlugin isn't null. Change-Id: I925b30dd7cad3d3587fcc6b10f888e30d45fc38a
Diffstat (limited to 'extensions/source/plugin/inc')
-rw-r--r--extensions/source/plugin/inc/plugin/impl.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx
index 6f1cc352c4a5..7ec12f716dec 100644
--- a/extensions/source/plugin/inc/plugin/impl.hxx
+++ b/extensions/source/plugin/inc/plugin/impl.hxx
@@ -331,6 +331,7 @@ enum PluginStreamType { InputStream, OutputStream };
class PluginStream
{
protected:
+ css::uno::WeakReference<css::uno::XInterface> m_wPlugin;
XPlugin_Impl* m_pPlugin;
NPStream m_aNPStream;
public: