summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.h
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2012-02-01 23:44:25 +0200
committerSeth ProductEngine <slitovchuk@productengine.com>2012-02-01 23:44:25 +0200
commit7314ac3a37d624e6a750fc12df64d08b584ad593 (patch)
tree9300080165a73bcb95d17e14573d89115ae1d25a /indra/newview/llscreenchannel.h
parentb3960899066156bc7d3fd5befb2f7e687a328152 (diff)
EXP-1672 FIXED Various fixes to prevent crashes in notifications.
- Refactoring of LLToast and LLScreenChannel classes: moved LLToast signals to the private section. - Modified the screen channel's lists of toasts to store LLHandles instead of pointers and screen channel code to work with toast LLHandles.
Diffstat (limited to 'indra/newview/llscreenchannel.h')
-rw-r--r--indra/newview/llscreenchannel.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index c9f8855fe6..695b6cd44d 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -163,7 +163,7 @@ public:
virtual bool matches(const LLNotificationPtr) const = 0;
};
- std::list<LLToast*> findToasts(const Matcher& matcher);
+ std::list<const LLToast*> findToasts(const Matcher& matcher);
// Channel's outfit-functions
// update channel's size and position in the World View
@@ -238,31 +238,39 @@ public:
reject_tost_signal_t mRejectToastSignal; boost::signals2::connection setOnRejectToastCallback(reject_tost_callback_t cb) { return mRejectToastSignal.connect(cb); }
private:
- struct ToastElem
+ class ToastElem
{
- LLUUID id;
- LLToast* toast;
+ public:
+ ToastElem(const LLHandle<LLToast>& toast) : mToast(toast)
+ {
+ }
- ToastElem(LLToast::Params p) : id(p.notif_id)
+ ToastElem(const ToastElem& toast_elem) : mToast(toast_elem.mToast)
{
- toast = new LLToast(p);
}
- ToastElem(const ToastElem& toast_elem)
+ LLToast* getToast() const
{
- id = toast_elem.id;
- toast = toast_elem.toast;
+ return mToast.get();
+ }
+
+ LLUUID getID() const
+ {
+ return mToast.isDead() ? LLUUID() : mToast.get()->getNotificationID();
}
bool operator == (const LLUUID &id_op) const
{
- return (id == id_op);
+ return (getID() == id_op);
}
bool operator == (LLPanel* panel_op) const
{
- return (toast == panel_op);
+ return (mToast.get() == panel_op);
}
+
+ private:
+ LLHandle<LLToast> mToast;
};
// Channel's handlers