diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index 73327ce2ee207e79038f318c3fe79a2c331350f4..7a704b71f35c28cde6aa615f2b50e3264da9bbff 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -192,6 +192,7 @@ void LLPluginProcessParent::shutdown()
             && state != STATE_ERROR)
         {
             (*it).second->setState(STATE_GOODBYE);
+            (*it).second->mOwner = NULL;
         }
         if (state != STATE_DONE)
         {
@@ -407,7 +408,10 @@ void LLPluginProcessParent::idle(void)
 			mMessagePipe->pumpOutput();
 			
 			// Only do input processing here if this instance isn't in a pollset.
-			if(!mPolledInput)
+            // If we are shutting down plugin, owner is null and we can't process
+            // input, we are here only to send shutdown_plugin message
+			if(!mPolledInput
+               && mState != STATE_GOODBYE)
 			{
 				mMessagePipe->pumpInput();
 			}