diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-10-30 11:18:12 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2020-03-25 19:05:17 -0400 |
commit | ec208ddfacd25409be49fbec00943c79dd24345f (patch) | |
tree | a9b7e457d4916b015bb23c6a54a72c9689353c13 /indra | |
parent | 7f1a2002142dfcda3cbada729d4fbe961b3bc7bb (diff) |
DRTVWR-476: Defend against late ~LLWatchdogTimeout() calls.
LLAppViewer's heap LLWatchdogTimeout might be destroyed very late -- as late
as in LLAppViewer's destructor. By that time, LLAppViewer::cleanup() has
already called LLSingletonBase::deleteAll(), destroying the LLWatchdog
LLSingleton instance.
But LLWatchdogTimeout isa LLWatchdogEntry, and ~LLWatchdogEntry() calls
stop(), and stop() tries to remove that instance from LLWatchdog, thus
inadvertently resurrecting the deleted LLWatchdog. Which is pointless because
the resurrected LLWatchdog has never heard of the LLWatchdogTimeout instance
trying to remove itself.
Defend LLWatchdogEntry::stop() against the case in which LLWatchdog has
already been deleted.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llwatchdog.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp index dd6c77ca7d..6273f10c69 100644 --- a/indra/newview/llwatchdog.cpp +++ b/indra/newview/llwatchdog.cpp @@ -91,7 +91,11 @@ void LLWatchdogEntry::start() void LLWatchdogEntry::stop() { - LLWatchdog::getInstance()->remove(this); + // this can happen very late in the shutdown sequence + if (! LLWatchdog::wasDeleted()) + { + LLWatchdog::getInstance()->remove(this); + } } // LLWatchdogTimeout |