summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationtiphandler.cpp
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2012-04-12 23:09:47 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2012-04-12 23:09:47 +0300
commitdd012cc375680c1907e16baa675d29d40ad4f43c (patch)
tree362e9d81ea18d1f041090ced8fd7ef34429ccdb1 /indra/newview/llnotificationtiphandler.cpp
parent7ef7bbef65d8622668bc8a007766f25a70386d27 (diff)
CHUI-87 FIXED crash in handling notifications after viewer disconnect.
Notification handlers now use LLHandles to screen channels.
Diffstat (limited to 'indra/newview/llnotificationtiphandler.cpp')
-rw-r--r--indra/newview/llnotificationtiphandler.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp
index fb0891c4c5..e397cfa046 100644
--- a/indra/newview/llnotificationtiphandler.cpp
+++ b/indra/newview/llnotificationtiphandler.cpp
@@ -46,11 +46,12 @@ LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id)
mType = type;
// Getting a Channel for our notifications
- mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
if(channel)
+ {
channel->setOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1));
+ mChannel = channel->getHandle();
+ }
}
//--------------------------------------------------------------------------
@@ -63,13 +64,13 @@ void LLTipHandler::initChannel()
{
S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin");
S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
- mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+ mChannel.get()->init(channel_right_bound - channel_width, channel_right_bound);
}
//--------------------------------------------------------------------------
bool LLTipHandler::processNotification(const LLSD& notify)
{
- if(!mChannel)
+ if(mChannel.isDead())
{
return false;
}
@@ -80,7 +81,7 @@ bool LLTipHandler::processNotification(const LLSD& notify)
return false;
// arrange a channel on a screen
- if(!mChannel->getVisible())
+ if(!mChannel.get()->getVisible())
{
initChannel();
}
@@ -137,13 +138,13 @@ bool LLTipHandler::processNotification(const LLSD& notify)
removeExclusiveNotifications(notification);
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)
channel->addToast(p);
}
else if (notify["sigtype"].asString() == "delete")
{
- mChannel->killToastByNotificationID(notification->getID());
+ mChannel.get()->killToastByNotificationID(notification->getID());
}
return false;
}