summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcolorswatch.cpp7
-rw-r--r--indra/newview/llcolorswatch.h2
-rw-r--r--indra/newview/llfloatercolorpicker.cpp10
3 files changed, 6 insertions, 13 deletions
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 )