diff options
author | Palmer Truelson <palmer@lindenlab.com> | 2010-02-23 17:19:58 -0800 |
---|---|---|
committer | Palmer Truelson <palmer@lindenlab.com> | 2010-02-23 17:19:58 -0800 |
commit | 54a95f706fe42cbef272c53e3fadfc2cf7ecfd0f (patch) | |
tree | d9b1f05ce695fa3ef5ee41949d3799d4e9a3e050 /indra/llplugin/llpluginprocesschild.cpp | |
parent | 7885748497d8b95f51c65f7f84a40d1405429616 (diff) | |
parent | 0980df1e0ce99bdafdd4e806cbacad96c71729cc (diff) |
merge
Diffstat (limited to 'indra/llplugin/llpluginprocesschild.cpp')
-rw-r--r-- | indra/llplugin/llpluginprocesschild.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 11c924cadf..52b5a319ec 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -43,6 +43,7 @@ static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will LLPluginProcessChild::LLPluginProcessChild() { + mState = STATE_UNINITIALIZED; mInstance = NULL; mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz @@ -277,14 +278,21 @@ bool LLPluginProcessChild::isDone(void) void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message) { - std::string buffer = message.generate(); - - LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; - LLTimer elapsed; - - mInstance->sendMessage(buffer); - - mCPUElapsed += elapsed.getElapsedTimeF64(); + if (mInstance) + { + std::string buffer = message.generate(); + + LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; + LLTimer elapsed; + + mInstance->sendMessage(buffer); + + mCPUElapsed += elapsed.getElapsedTimeF64(); + } + else + { + LL_WARNS("Plugin") << "mInstance == NULL" << LL_ENDL; + } } void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) |