diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-05-31 09:51:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-05-31 09:51:54 +0200 |
commit | 052f25429eb6bf832c9e9bca6169755966ea794d (patch) | |
tree | 042ee8fc7f67cb84dd1eeaac3b73d581680f2ddf /include/vcl | |
parent | bef247d1370d9a5a83bfd2ccde70db37da0e7f30 (diff) |
Guard against ScopedVclPtr "self assignment" (just in case)
Change-Id: I12bbfbc6701e4e666d30dcf89c17be8f1a5d6858
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/vclptr.hxx | 6 |
1 files changed, 4 insertions, 2 deletions
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); + } } /** |