[Libreoffice-commits] core.git: include/vcl vcl/source

Stephan Bergmann sbergman at redhat.com
Thu Jun 18 00:57:05 PDT 2015


 include/vcl/btndlg.hxx       |    2 +-
 vcl/source/window/btndlg.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e5a8d8c065c50316fbdd84424794aecaa634bdb5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 18 09:54:01 2015 +0200

    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

diff --git a/include/vcl/btndlg.hxx b/include/vcl/btndlg.hxx
index 156a50d..6ae2824 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 102f5ce..6b141fe 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 )


More information about the Libreoffice-commits mailing list