diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-02-17 19:49:27 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:22:10 +0100 |
commit | ef5ee3247467a2bae5ae12f758a75758f58afaa4 (patch) | |
tree | 63b9f622da893cdf732e1f1d021b44a973bfdb6c /vcl | |
parent | 8b9b9985b04b8f3b602890806ea905f8c7cb45ba (diff) |
vcl: more double-dispose protection, and survival after dispose.
Change-Id: I271f9bcb85d07a28abef2d97ef3c31287878324d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/lifecycle.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx index 8a453d46aeaa..3492b52327a7 100644 --- a/vcl/qa/cppunit/lifecycle.cxx +++ b/vcl/qa/cppunit/lifecycle.cxx @@ -73,11 +73,11 @@ void LifecycleTest::testWidgets(vcl::Window *pParent) // Some widgets really insist on adoption. if (pParent) { - { VclPtr<CheckBox> aPtr(new CheckBox(pParent)); } -// { VclPtr<Edit> aPtr(new Edit(pParent)); } -// { VclPtr<ComboBox> aPtr(new ComboBox(pParent)); } + { VclPtr<CheckBox> aPtr(new CheckBox(pParent)); } + { VclPtr<Edit> aPtr(new Edit(pParent)); } + { VclPtr<ComboBox> aPtr(new ComboBox(pParent)); } + { VclPtr<RadioButton> aPtr(new RadioButton(pParent)); } } -// { VclPtr<RadioButton> aPtr(new RadioButton(pParent)); } } void LifecycleTest::testIsolatedWidgets() diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 6396465e855f..c0e5d9bb8310 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1267,7 +1267,7 @@ void ComboBox::SetMRUEntries( const OUString& rEntries, sal_Unicode cSep ) OUString ComboBox::GetMRUEntries( sal_Unicode cSep ) const { - return mpImplLB->GetMRUEntries( cSep ); + return mpImplLB ? mpImplLB->GetMRUEntries( cSep ) : OUString(); } void ComboBox::SetMaxMRUCount( sal_Int32 n ) @@ -1277,12 +1277,12 @@ void ComboBox::SetMaxMRUCount( sal_Int32 n ) sal_Int32 ComboBox::GetMaxMRUCount() const { - return mpImplLB->GetMaxMRUCount(); + return mpImplLB ? mpImplLB->GetMaxMRUCount() : 0; } sal_uInt16 ComboBox::GetDisplayLineCount() const { - return mpImplLB->GetDisplayLineCount(); + return mpImplLB ? mpImplLB->GetDisplayLineCount() : 0; } void ComboBox::SetEntryData( sal_Int32 nPos, void* pNewData ) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index a3398ea17e2c..1e60f08900cb 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1381,7 +1381,7 @@ const Pointer& Window::GetPointer() const VCLXWindow* Window::GetWindowPeer() const { - return mpWindowImpl->mpVCLXWindow; + return mpWindowImpl ? mpWindowImpl->mpVCLXWindow : NULL; } void Window::SetPosPixel( const Point& rNewPos ) |