summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-07-01 17:28:58 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-07-01 17:28:58 +0300
commit23591b8ab7917a239daa055dc862728fa8a911de (patch)
treecad4df5b106d898a42d1053ef7c4f74fe679a86c /indra
parent8bf2fb06218f24f95a7ff53df33b647b4ec088fc (diff)
SL-3704 Plugin exit issues
Diffstat (limited to 'indra')
-rw-r--r--indra/llplugin/llpluginprocesschild.cpp7
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp7
-rw-r--r--indra/media_plugins/example/media_plugin_example.cpp4
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp4
4 files changed, 20 insertions, 2 deletions
diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp
index e24d222cb6..8fb3054eac 100644
--- a/indra/llplugin/llpluginprocesschild.cpp
+++ b/indra/llplugin/llpluginprocesschild.cpp
@@ -33,7 +33,7 @@
#include "llpluginmessagepipe.h"
#include "llpluginmessageclasses.h"
-static const F32 GOODBYE_SECONDS = 20.0f;
+static const F32 GOODBYE_SECONDS = 12.0f; // Do not set it to be bigger than mPluginLockupTimeout or parent will kill LLPluginProcessChild
static const F32 HEARTBEAT_SECONDS = 1.0f;
static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will give the plugin this much time.
@@ -218,6 +218,11 @@ void LLPluginProcessChild::idle(void)
if (mWaitGoodbye.hasExpired())
{
LL_WARNS() << "Wait for goodbye expired. Advancing to UNLOADED" << LL_ENDL;
+ if (mInstance != NULL)
+ {
+ // Something went wrong, at least make sure plugin will terminate
+ sendMessageToPlugin(LLPluginMessage("base", "force_exit"));
+ }
setState(STATE_UNLOADED);
}
break;
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 264289abac..c497a96cdc 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -246,6 +246,7 @@ void MediaPluginCEF::onRequestExitCallback()
LLPluginMessage message("base", "goodbye");
sendMessage(message);
+ // Will trigger delete on next staticReceiveMessage()
mDeleteMe = true;
}
@@ -442,9 +443,13 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
}
else if (message_name == "cleanup")
{
- mVolumeCatcher.setVolume(0);
+ mVolumeCatcher.setVolume(0); // Hack: masks CEF exit issues
mCEFLib->requestExit();
}
+ else if (message_name == "force_exit")
+ {
+ mDeleteMe = true;
+ }
else if (message_name == "shm_added")
{
SharedSegmentInfo info;
diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp
index c296a0413d..650685fb94 100644
--- a/indra/media_plugins/example/media_plugin_example.cpp
+++ b/indra/media_plugins/example/media_plugin_example.cpp
@@ -128,6 +128,10 @@ void mediaPluginExample::receiveMessage(const char* message_string)
mDeleteMe = true;
}
+ else if (message_name == "force_exit")
+ {
+ mDeleteMe = true;
+ }
else if (message_name == "shm_added")
{
SharedSegmentInfo info;
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
index 80702a1079..f7d35b33c2 100644
--- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
+++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
@@ -495,6 +495,10 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
{
resetVLC();
}
+ else if (message_name == "force_exit")
+ {
+ mDeleteMe = true;
+ }
else if (message_name == "shm_added")
{
SharedSegmentInfo info;