From ef5ee3247467a2bae5ae12f758a75758f58afaa4 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 17 Feb 2015 19:49:27 +0000 Subject: vcl: more double-dispose protection, and survival after dispose. Change-Id: I271f9bcb85d07a28abef2d97ef3c31287878324d --- svtools/source/control/ctrlbox.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'svtools') diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2bac5a8a3567..80e22ae558e1 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -123,8 +123,12 @@ ColorListBox::~ColorListBox() void ColorListBox::dispose() { - ImplDestroyColorEntries(); - delete pColorList; + if ( pColorList ) + { + ImplDestroyColorEntries(); + delete pColorList; + pColorList = NULL; + } ListBox::dispose(); } @@ -953,8 +957,11 @@ FontNameBox::~FontNameBox() void FontNameBox::dispose() { - SaveMRUEntries (maFontMRUEntriesFile); - ImplDestroyFontList(); + if (mpFontList) + { + SaveMRUEntries (maFontMRUEntriesFile); + ImplDestroyFontList(); + } ComboBox::dispose(); } @@ -1017,6 +1024,7 @@ void FontNameBox::InitFontMRUEntriesFile() void FontNameBox::ImplDestroyFontList() { delete mpFontList; + mpFontList = NULL; } void FontNameBox::Fill( const FontList* pList ) -- cgit