summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-01-28 21:43:28 -0700
committerXiaohong Bao <bao@lindenlab.com>2011-01-28 21:43:28 -0700
commitfe253e6ec6f77a7967cadd6efd76b2fbbef4e2da (patch)
tree1718b5344c34b752802879062910c0cc63e64028 /indra/newview
parent403b509f3aac52c25d6207f35db5fed96a953a88 (diff)
merge the changeset 4de3178c6c81 from viewer-development: fixed the major memory leaking for SH-723/SH-847: memoy leaking
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfirstuse.cpp58
-rw-r--r--indra/newview/llfirstuse.h9
2 files changed, 38 insertions, 29 deletions
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 4c17199895..4d252dc662 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -41,35 +41,36 @@
// static
-std::set<std::string> LLFirstUse::sConfigVariables;
+//std::set<std::string> LLFirstUse::sConfigVariables;
+std::set<std::string> LLFirstUse::sConfigVariablesEnabled;
// static
-void LLFirstUse::addConfigVariable(const std::string& var)
-{
- sConfigVariables.insert(var);
-}
+//void LLFirstUse::addConfigVariable(const std::string& var)
+//{
+// sConfigVariables.insert(var);
+//}
// static
-void LLFirstUse::disableFirstUse()
-{
- // Set all first-use warnings to disabled
- for (std::set<std::string>::iterator iter = sConfigVariables.begin();
- iter != sConfigVariables.end(); ++iter)
- {
- gWarningSettings.setBOOL(*iter, FALSE);
- }
-}
+//void LLFirstUse::disableFirstUse()
+//{
+// // Set all first-use warnings to disabled
+// for (std::set<std::string>::iterator iter = sConfigVariables.begin();
+// iter != sConfigVariables.end(); ++iter)
+// {
+// gWarningSettings.setBOOL(*iter, FALSE);
+// }
+//}
// static
-void LLFirstUse::resetFirstUse()
-{
- // Set all first-use warnings to disabled
- for (std::set<std::string>::iterator iter = sConfigVariables.begin();
- iter != sConfigVariables.end(); ++iter)
- {
- gWarningSettings.setBOOL(*iter, TRUE);
- }
-}
+//void LLFirstUse::resetFirstUse()
+//{
+// // Set all first-use warnings to disabled
+// for (std::set<std::string>::iterator iter = sConfigVariables.begin();
+// iter != sConfigVariables.end(); ++iter)
+// {
+// gWarningSettings.setBOOL(*iter, TRUE);
+// }
+//}
// static
void LLFirstUse::otherAvatarChatFirst(bool enable)
@@ -151,13 +152,21 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl
if (enable)
{
+ if(sConfigVariablesEnabled.find(control_var) != sConfigVariablesEnabled.end())
+ {
+ return ; //already added
+ }
+
if (gSavedSettings.getBOOL("EnableUIHints"))
{
LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL;
// if notification doesn't already exist and this notification hasn't been disabled...
if (gWarningSettings.getBOOL(control_var))
- { // create new notification
+ {
+ sConfigVariablesEnabled.insert(control_var) ;
+
+ // create new notification
LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var)));
}
}
@@ -169,7 +178,6 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl
// redundantly clear settings var here, in case there are no notifications to cancel
gWarningSettings.setBOOL(control_var, FALSE);
}
-
}
// static
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index 81659988e6..489f58626a 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -78,11 +78,11 @@ class LLFirstUse
public:
// Add a config variable to be reset on resetFirstUse()
- static void addConfigVariable(const std::string& var);
+ //static void addConfigVariable(const std::string& var);
// Sets all controls back to show the dialogs.
- static void disableFirstUse();
- static void resetFirstUse();
+ //static void disableFirstUse();
+ //static void resetFirstUse();
static void otherAvatarChatFirst(bool enable = true);
static void sit(bool enable = true);
@@ -98,7 +98,8 @@ public:
protected:
static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD());
- static std::set<std::string> sConfigVariables;
+ //static std::set<std::string> sConfigVariables;
+ static std::set<std::string> sConfigVariablesEnabled;
static void init();
static bool processNotification(const LLSD& notify);