diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index b2c450aa0c7e3b914cc1114eb0f3d6912c11b5be..da912ef3d48de17770c67dcf42f71ce168cdb2ba 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -349,8 +349,8 @@ void LLScriptFloater::hideToastsIfNeeded() ////////////////////////////////////////////////////////////////////////// LLScriptFloaterManager::LLScriptFloaterManager() + : mDialogLimitationsSlot() { - gSavedSettings.getControl("ScriptDialogLimitations")->getCommitSignal()->connect(boost::bind(&clearScriptNotifications)); } void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) @@ -361,6 +361,19 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) return; } + if (!mDialogLimitationsSlot.connected()) + { + LLPointer<LLControlVariable> cntrl_ptr = gSavedSettings.getControl("ScriptDialogLimitations"); + if (cntrl_ptr.notNull()) + { + mDialogLimitationsSlot = cntrl_ptr->getCommitSignal()->connect(boost::bind(&clearScriptNotifications)); + } + else + { + LL_WARNS() << "Unable to set signal on setting 'ScriptDialogLimitations'" << LL_ENDL; + } + } + // get scripted Object's ID LLUUID object_id = notification_id_to_object_id(notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 0192a8893e11ac5b80135a4da42e550ae4e0c396..3695b8a3e129c64d447d0685a59167b33dccd06c 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -139,6 +139,7 @@ class LLScriptFloaterManager : public LLSingleton<LLScriptFloaterManager> typedef std::map<LLUUID, FloaterPositionInfo> floater_position_map_t; floater_position_map_t mFloaterPositions; + boost::signals2::connection mDialogLimitationsSlot; }; /**