[Libreoffice-commits] core.git: include/vcl
Stephan Bergmann
sbergman at redhat.com
Wed May 31 07:52:44 UTC 2017
include/vcl/vclptr.hxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 052f25429eb6bf832c9e9bca6169755966ea794d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed May 31 09:51:54 2017 +0200
Guard against ScopedVclPtr "self assignment" (just in case)
Change-Id: I12bbfbc6701e4e666d30dcf89c17be8f1a5d6858
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx
index a11552635082..8dc250c7a640 100644
--- a/include/vcl/vclptr.hxx
+++ b/include/vcl/vclptr.hxx
@@ -316,8 +316,10 @@ public:
*/
void disposeAndReset(reference_type *pBody)
{
- VclPtr<reference_type>::disposeAndClear();
- VclPtr<reference_type>::set(pBody);
+ if (pBody != this->get()) {
+ VclPtr<reference_type>::disposeAndClear();
+ VclPtr<reference_type>::set(pBody);
+ }
}
/**
More information about the Libreoffice-commits
mailing list