From 5a02b66cd293ca9deb0144c3ac106dd9e5dc0836 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 10 Dec 2009 11:01:18 -0500 Subject: EXT-2819 : Crash in appearance color picker Enforcing out-of-order destruction in llfloatercustomize to avoid this crash. --- indra/newview/llcolorswatch.cpp | 7 +++++-- indra/newview/llcolorswatch.h | 2 +- indra/newview/llfloatercolorpicker.cpp | 10 ---------- 3 files changed, 6 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index b2399d238b..dc6847f236 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -306,13 +306,16 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op ) } } -void LLColorSwatchCtrl::onFloaterClose() +// This is called when the main floatercustomize panel is closed. +// Since this class has pointers up to its parents, we need to cleanup +// this class first in order to avoid a crash. +void LLColorSwatchCtrl::onParentFloaterClosed() { LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get(); - if (pickerp) { pickerp->setSwatch(NULL); + pickerp->closeFloater(); } mPickerHandle.markDead(); diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h index 2f6aec85e8..4bb7d837cb 100644 --- a/indra/newview/llcolorswatch.h +++ b/indra/newview/llcolorswatch.h @@ -105,7 +105,7 @@ public: /*virtual*/ void setEnabled( BOOL enabled ); static void onColorChanged ( void* data, EColorPickOp pick_op = COLOR_CHANGE ); - void onFloaterClose(); + void onParentFloaterClosed(); protected: BOOL mValid; diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 56b56dc3d2..73b79d8e13 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -241,16 +241,6 @@ BOOL LLFloaterColorPicker::postBuild() return TRUE; } -/*virtual*/ -void LLFloaterColorPicker::onClose(bool app_settings) -{ - if (mSwatch) - { - mSwatch->onFloaterClose(); - } - stopUsingPipette(); -} - ////////////////////////////////////////////////////////////////////////////// // void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn ) -- cgit v1.2.3