From 166f75d91f180d0ac45f0b8ee7c3a1b6742209fa Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 6 Jun 2012 16:38:16 -0400 Subject: MAINT-1144: Defend against NULL LLPluginProcessParent::mProcess. The change from LLProcessLauncher to LLProcess introduces the possibility of a NULL (default-constructed) LLProcessPtr. Add certain static LLProcess methods accepting LLProcessPtr, forwarding to nonstatic method when non-NULL but doing something reasonable with NULL. Use these methods in LLPLuginProcessParent. --- indra/llplugin/llpluginprocessparent.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index f10eaee5b4..71a6145b58 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -134,11 +134,8 @@ LLPluginProcessParent::~LLPluginProcessParent() // and remove it from our map mSharedMemoryRegions.erase(iter); } - - if (mProcess) - { - mProcess->kill(); - } + + LLProcess::kill(mProcess); killSockets(); } @@ -471,7 +468,7 @@ void LLPluginProcessParent::idle(void) break; case STATE_EXITING: - if (! mProcess->isRunning()) + if (! LLProcess::isRunning(mProcess)) { setState(STATE_CLEANUP); } @@ -499,7 +496,7 @@ void LLPluginProcessParent::idle(void) break; case STATE_CLEANUP: - mProcess->kill(); + LLProcess::kill(mProcess); killSockets(); setState(STATE_DONE); break; @@ -1078,7 +1075,7 @@ bool LLPluginProcessParent::pluginLockedUpOrQuit() { bool result = false; - if (! mProcess->isRunning()) + if (! LLProcess::isRunning(mProcess)) { LL_WARNS("Plugin") << "child exited" << LL_ENDL; result = true; -- cgit v1.2.3