summaryrefslogtreecommitdiff
path: root/indra/llmessage/message.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2015-05-23 12:41:47 -0400
committerNat Goodspeed <nat@lindenlab.com>2015-05-23 12:41:47 -0400
commit430263746424bd0a7c6647d25d9d1db5eca2e8c0 (patch)
treec8f94523e5ebcefa3fc578a76a947f5223c8be56 /indra/llmessage/message.cpp
parentdf3da846243cce973468b15d1f1752db2009d4ba (diff)
MAINT-5232: Make gMessageSystem an LLPounceable<LLMessageSystem*>.
This will permit other subsystems to use gMessageSystem.callWhenReady() to (e.g.) register callbacks as soon as gMessageSystem is fully initialized.
Diffstat (limited to 'indra/llmessage/message.cpp')
-rwxr-xr-xindra/llmessage/message.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index e9ce94ab3b..3c3683f12a 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -77,6 +77,7 @@
#include "v3math.h"
#include "v4math.h"
#include "lltransfertargetvfile.h"
+#include "llpounceable.h"
// Constants
//const char* MESSAGE_LOG_FILENAME = "message.log";
@@ -1776,7 +1777,9 @@ std::ostream& operator<<(std::ostream& s, LLMessageSystem &msg)
return s;
}
-LLMessageSystem *gMessageSystem = NULL;
+// LLPounceable supports callWhenReady(), to permit clients to queue up (e.g.)
+// callback registrations for when gMessageSystem is first assigned
+LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
// update appropriate ping info
void process_complete_ping_check(LLMessageSystem *msgsystem, void** /*user_data*/)
@@ -2693,7 +2696,7 @@ void end_messaging_system(bool print_summary)
LL_INFOS("Messaging") << str.str().c_str() << LL_ENDL;
}
- delete gMessageSystem;
+ delete static_cast<LLMessageSystem*>(gMessageSystem);
gMessageSystem = NULL;
}
}