diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2015-08-18 17:05:29 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2015-08-18 17:05:29 -0400 |
commit | 62527e6f18f0a035a234cf584e31f7eea93fd4a7 (patch) | |
tree | 29f532cde7b0cf0fbf96cd4def3c89c77717b8fb /indra/llui | |
parent | 02b7e7ce07948a25bc1f58fdbfe3499dc917340f (diff) |
MAINT-5506: Fix ugly timing bug in llurlentry static initialization.
The problem was that class-static LLUrlEntryParcel::sRegionHost was being
initialized by copying class-static LLHost::invalid. Naturally, these two
statics are initialized in different source files. Since C++ makes no promises
about the relative order in which objects in different object files are
initialized, it seems we hit a case in which we were trying to initialize
sRegionHost by copying a completely uninitialized LLHost::invalid.
In general we might attempt to address such cross-translation-unit issues by
introducing an LLSingleton. But in this particular case, the punch line is
that LLHost::invalid is explicitly constructed identically to a
default-constructed LLHost! In other words, LLHost::invalid provides nothing
we couldn't get from LLHost(). All it gives us is an opportunity for glitches
such as the above.
Remove LLHost::invalid and all references, replacing with LLHost().
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llurlentry.cpp | 4 | ||||
-rwxr-xr-x | indra/llui/tests/llurlentry_stub.cpp | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 6db0d88998..adefae6e2d 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -957,7 +957,7 @@ std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const // LLUrlEntryParcel statics. LLUUID LLUrlEntryParcel::sAgentID(LLUUID::null); LLUUID LLUrlEntryParcel::sSessionID(LLUUID::null); -LLHost LLUrlEntryParcel::sRegionHost(LLHost::invalid); +LLHost LLUrlEntryParcel::sRegionHost; bool LLUrlEntryParcel::sDisconnected(false); std::set<LLUrlEntryParcel*> LLUrlEntryParcel::sParcelInfoObservers; @@ -1006,7 +1006,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC void LLUrlEntryParcel::sendParcelInfoRequest(const LLUUID& parcel_id) { - if (sRegionHost == LLHost::invalid || sDisconnected) return; + if (sRegionHost == LLHost() || sDisconnected) return; LLMessageSystem *msg = gMessageSystem; msg->newMessage("ParcelInfoRequest"); diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 5d3f9ac327..f01178c374 100755 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -165,8 +165,6 @@ LLFontGL* LLFontGL::getFontDefault() char const* const _PREHASH_AgentData = (char *)"AgentData"; char const* const _PREHASH_AgentID = (char *)"AgentID"; -LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS); - LLMessageSystem* gMessageSystem = NULL; // |