Fix the Octopus to not segfault anymore
This commit is contained in:
@@ -265,8 +265,9 @@ void HippoFloaterXml::execute(const std::string &cmds)
|
|||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
// generic notification callbacks
|
// generic notification callbacks
|
||||||
|
|
||||||
static void notifyCallback(LLUICtrl *ctrl)
|
static void notifyCallback(void *c)
|
||||||
{
|
{
|
||||||
|
LLUICtrl *ctrl = (LLUICtrl *)c;
|
||||||
std::string msg = "NOTIFY:";
|
std::string msg = "NOTIFY:";
|
||||||
msg += ctrl->getName();
|
msg += ctrl->getName();
|
||||||
msg += ':';
|
msg += ':';
|
||||||
@@ -324,20 +325,17 @@ bool HippoFloaterXmlImpl::execute(LLUICtrl *ctrl,
|
|||||||
bool set = (value != "0");
|
bool set = (value != "0");
|
||||||
if (HippoFloaterXmlImpl *floater = dynamic_cast<HippoFloaterXmlImpl*>(ctrl)) {
|
if (HippoFloaterXmlImpl *floater = dynamic_cast<HippoFloaterXmlImpl*>(ctrl)) {
|
||||||
floater->mIsNotifyOnClose = set;
|
floater->mIsNotifyOnClose = set;
|
||||||
} else if (LLButton *button = dynamic_cast<LLButton*>(ctrl))
|
} else if (LLButton *button = dynamic_cast<LLButton*>(ctrl)) {
|
||||||
{
|
if (set)
|
||||||
if (set)
|
button->setClickedCallback(boost::bind(¬ifyCallback, _1), ctrl);
|
||||||
floater->mNotices[button] = notice_ptr_t(new notice_connection_t(button->setClickedCallback(boost::bind(¬ifyCallback, ctrl))));
|
else
|
||||||
else
|
button->setClickedCallback(0, 0);
|
||||||
floater->mNotices.erase(button);
|
} else {
|
||||||
}
|
if (set)
|
||||||
else
|
ctrl->setCommitCallback(boost::bind(¬ifyCallback, _1), ctrl);
|
||||||
{
|
else
|
||||||
if (set)
|
ctrl->setCommitCallback(0);
|
||||||
floater->mNotices[ctrl] = notice_ptr_t(new notice_connection_t(ctrl->setCommitCallback(boost::bind(¬ifyCallback, ctrl))));
|
}
|
||||||
else
|
|
||||||
floater->mNotices.erase(ctrl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user