viewer#1290 Fix snapToMessageHeight crash

master
Andrey Kleshchev 2024-04-19 22:40:49 +03:00 committed by Andrey Kleshchev
parent 4016a08607
commit 5ad488a4a6
2 changed files with 13 additions and 2 deletions

View File

@ -56,8 +56,9 @@ const std::string LLToastNotifyPanel::sFontScript("SansSerif");
LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal;
LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images)
: LLCheckBoxToastPanel(notification),
LLInstanceTracker<LLToastNotifyPanel, LLUUID, LLInstanceTrackerReplaceOnCollision>(notification->getID())
: LLCheckBoxToastPanel(notification)
, LLInstanceTracker<LLToastNotifyPanel, LLUUID, LLInstanceTrackerReplaceOnCollision>(notification->getID())
, mTextBox(NULL)
{
init(rect, show_images);
}
@ -432,6 +433,15 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
}
}
void LLToastNotifyPanel::deleteAllChildren()
{
// some visibility changes, re-init and reshape will attempt to
// use mTextBox. Null it beforehand to avoid crashes.
mTextBox = NULL;
LLCheckBoxToastPanel::deleteAllChildren();
}
bool LLToastNotifyPanel::isControlPanelEnabled() const
{
bool cp_enabled = mControlPanel->getEnabled();

View File

@ -63,6 +63,7 @@ public:
LLToastNotifyPanel(const LLNotificationPtr& pNotification, const LLRect& rect = LLRect::null, bool show_images = true);
virtual void init( LLRect rect, bool show_images );
virtual void deleteAllChildren();
virtual ~LLToastNotifyPanel();
LLPanel * getControlPanel() { return mControlPanel; }