summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-06-27 08:33:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-06-27 10:57:59 +0200
commit6ebc026e34d0c119067e7dfbad8d932f92844760 (patch)
tree7a4b6e61120581987d02768b736589431ec257df /include
parentee45d881efab230e7682f964d6ad4d00f85b0006 (diff)
salhelper::SingletonRef copy ctor is broken, mark as deleted
If that (implicitly defined) ctor had ever been used, it would have failed to increment m_nRef, so could have caused m_pInstance to be deleted too early. So better mark it as deleted. (LO itself apparently didn't call it. If 3rd party code would want to call it after all, it could be changed from deleted to properly user-provided, incrementing m_nRef, in the future.) The implicitly defined copy assignment op happens to already do the right thing, and /is/ used, e.g., during > m_aNode = _rhs.m_aNode; in DriversConfig::operator= (connectivity/source/commontools/DriversConfig.cxx). Mark it as defaulted to avoid -Wdeprecated-copy with GCC trunk towards GCC 9. Change-Id: I527123d9de837c311d30a270feb09dc173d9f411 Reviewed-on: https://gerrit.libreoffice.org/56512 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/salhelper/singletonref.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/salhelper/singletonref.hxx b/include/salhelper/singletonref.hxx
index 45f685835d54..9d9747ee70ae 100644
--- a/include/salhelper/singletonref.hxx
+++ b/include/salhelper/singletonref.hxx
@@ -131,6 +131,9 @@ class SingletonRef
// <- GLOBAL SAFE
}
+#if defined LIBO_INTERNAL_ONLY
+ SingletonRef & operator =(SingletonRef const &) = default;
+#endif
/** @short Allows rSingle->someBodyOp().
*/
@@ -157,7 +160,7 @@ class SingletonRef
// helper
private:
-
+ SingletonRef(SingletonRef &) SAL_DELETED_FUNCTION;
/** @short creates an own mutex for guarding static contents.