EXT-2819 : Crash in appearance color picker

Enforcing out-of-order destruction in llfloatercustomize to avoid this crash.
master
Loren Shih 2009-12-10 11:01:18 -05:00
parent e2360f3d39
commit 5a02b66cd2
3 changed files with 6 additions and 13 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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 )