summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-18 09:54:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-18 09:54:01 +0200
commite5a8d8c065c50316fbdd84424794aecaa634bdb5 (patch)
tree3a5673155ba4efb99d2a06f8e87761b1796c8f45
parent437210d58f32177ef1829d704f7f4d2f1bbfbfdd (diff)
Don't immediately release temporary VclPtr returned from Create
...the only reason this didn't cause any problems is that the VclPtr returned from Create already had an mnRefCnt > 1, because of activity in the PushButton ctor. Change-Id: I1066ff0b507b8a1ebff079f7b914235a7396368d
-rw-r--r--include/vcl/btndlg.hxx2
-rw-r--r--vcl/source/window/btndlg.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/vcl/btndlg.hxx b/include/vcl/btndlg.hxx
index 156a50d416e8..6ae2824bb1e3 100644
--- a/include/vcl/btndlg.hxx
+++ b/include/vcl/btndlg.hxx
@@ -96,7 +96,7 @@ private:
Link<> maClickHdl;
SAL_DLLPRIVATE void ImplInitButtonDialogData();
- SAL_DLLPRIVATE PushButton* ImplCreatePushButton( ButtonDialogFlags nBtnFlags );
+ SAL_DLLPRIVATE VclPtr<PushButton> ImplCreatePushButton( ButtonDialogFlags nBtnFlags );
SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( sal_uInt16 nId ) const;
DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* pBtn );
SAL_DLLPRIVATE void ImplPosControls();
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 102f5ce839bd..6b141fe37bdc 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -73,9 +73,9 @@ void ButtonDialog::dispose()
Dialog::dispose();
}
-PushButton* ButtonDialog::ImplCreatePushButton( ButtonDialogFlags nBtnFlags )
+VclPtr<PushButton> ButtonDialog::ImplCreatePushButton( ButtonDialogFlags nBtnFlags )
{
- PushButton* pBtn;
+ VclPtr<PushButton> pBtn;
WinBits nStyle = 0;
if ( nBtnFlags & ButtonDialogFlags::Default )