summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerror.cpp
diff options
context:
space:
mode:
authorAnkur Ahlawat <anchor@lindenlab.com>2018-01-17 15:53:56 -0800
committerAnkur Ahlawat <anchor@lindenlab.com>2018-01-17 15:53:56 -0800
commit5a12a88f7b53bb99a6b302c35d891a8ecee59855 (patch)
treedd52f7a9f76ac5d696a517f351371ceb619b7d30 /indra/llcommon/llerror.cpp
parentd4ce47b09122d1f76601ba402c2b9ad6bb504950 (diff)
parent7acbd8ed8d73c507675d45360df07d232c431a8b (diff)
Merged lindenlab/viewer-release into default
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rw-r--r--indra/llcommon/llerror.cpp97
1 files changed, 62 insertions, 35 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 9c49f7eff4..cfca42809a 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -1067,7 +1067,15 @@ namespace LLError
{
return false;
}
-
+
+ // If we hit a logging request very late during shutdown processing,
+ // when either of the relevant LLSingletons has already been deleted,
+ // DO NOT resurrect them.
+ if (Settings::wasDeleted() || Globals::wasDeleted())
+ {
+ return false;
+ }
+
SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
s->mShouldLogCallCounter++;
@@ -1106,7 +1114,10 @@ namespace LLError
std::ostringstream* Log::out()
{
LogLock lock;
- if (lock.ok())
+ // If we hit a logging request very late during shutdown processing,
+ // when either of the relevant LLSingletons has already been deleted,
+ // DO NOT resurrect them.
+ if (lock.ok() && ! (Settings::wasDeleted() || Globals::wasDeleted()))
{
Globals* g = Globals::getInstance();
@@ -1116,41 +1127,49 @@ namespace LLError
return &g->messageStream;
}
}
-
+
return new std::ostringstream;
}
-
+
void Log::flush(std::ostringstream* out, char* message)
- {
- LogLock lock;
- if (!lock.ok())
- {
- return;
- }
-
- if(strlen(out->str().c_str()) < 128)
- {
- strcpy(message, out->str().c_str());
- }
- else
- {
- strncpy(message, out->str().c_str(), 127);
- message[127] = '\0' ;
- }
-
- Globals* g = Globals::getInstance();
- if (out == &g->messageStream)
- {
- g->messageStream.clear();
- g->messageStream.str("");
- g->messageStreamInUse = false;
- }
- else
- {
- delete out;
- }
- return ;
- }
+ {
+ LogLock lock;
+ if (!lock.ok())
+ {
+ return;
+ }
+
+ // If we hit a logging request very late during shutdown processing,
+ // when either of the relevant LLSingletons has already been deleted,
+ // DO NOT resurrect them.
+ if (Settings::wasDeleted() || Globals::wasDeleted())
+ {
+ return;
+ }
+
+ if(strlen(out->str().c_str()) < 128)
+ {
+ strcpy(message, out->str().c_str());
+ }
+ else
+ {
+ strncpy(message, out->str().c_str(), 127);
+ message[127] = '\0' ;
+ }
+
+ Globals* g = Globals::getInstance();
+ if (out == &g->messageStream)
+ {
+ g->messageStream.clear();
+ g->messageStream.str("");
+ g->messageStreamInUse = false;
+ }
+ else
+ {
+ delete out;
+ }
+ return ;
+ }
void Log::flush(std::ostringstream* out, const CallSite& site)
{
@@ -1159,7 +1178,15 @@ namespace LLError
{
return;
}
-
+
+ // If we hit a logging request very late during shutdown processing,
+ // when either of the relevant LLSingletons has already been deleted,
+ // DO NOT resurrect them.
+ if (Settings::wasDeleted() || Globals::wasDeleted())
+ {
+ return;
+ }
+
Globals* g = Globals::getInstance();
SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();