summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationgrouphandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnotificationgrouphandler.cpp')
-rw-r--r--indra/newview/llnotificationgrouphandler.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp
index 97e382e42f..50db4737ce 100644
--- a/indra/newview/llnotificationgrouphandler.cpp
+++ b/indra/newview/llnotificationgrouphandler.cpp
@@ -41,10 +41,11 @@ LLGroupHandler::LLGroupHandler()
: LLSysHandler("Group Notifications", "groupnotify")
{
// Getting a Channel for our notifications
- mChannel = LLChannelManager::getInstance()->createNotificationChannel();
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
if(channel)
channel->addOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
+ mChannel = channel->getHandle();
+ }
}
//--------------------------------------------------------------------------
@@ -57,19 +58,19 @@ void LLGroupHandler::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 LLGroupHandler::processNotification(const LLNotificationPtr& notification)
{
- if(!mChannel)
+ if(mChannel.isDead())
{
return false;
}
// arrange a channel on a screen
- if(!mChannel->getVisible())
+ if(!mChannel.get()->getVisible())
{
initChannel();
}
@@ -83,7 +84,7 @@ bool LLGroupHandler::processNotification(const LLNotificationPtr& notification)
p.panel = notify_box;
p.on_delete_toast = boost::bind(&LLGroupHandler::onDeleteToast, this, _1);
- LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+ LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
if(channel)
channel->addToast(p);