From 3f2f1f487704005190dfde5b6c3ed945b646730a Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 8 Dec 2009 00:26:42 +0000 Subject: [PATCH] fix splash window when crash at startup --- direct/src/plugin_npapi/ppInstance.cxx | 6 ++++-- direct/src/plugin_npapi/ppInstance.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin_npapi/ppInstance.cxx b/direct/src/plugin_npapi/ppInstance.cxx index 6f1c352abb..7c59e17405 100644 --- a/direct/src/plugin_npapi/ppInstance.cxx +++ b/direct/src/plugin_npapi/ppInstance.cxx @@ -55,6 +55,7 @@ PPInstance(NPMIMEType pluginType, NPP instance, uint16_t mode, _npp_mode = mode; _script_object = NULL; _failed = false; + _started = false; // Copy the tokens and save them within this object. _tokens.reserve(argc); @@ -287,7 +288,7 @@ stop_outstanding_streams() { streams.swap(_streams); for (si = streams.begin(); si != streams.end(); ++si) { NPStream *stream = (*si); - nout << "Stopping stream " << stream->url << "\n"; + nout << "Stopping stream " << (void *)stream << "\n"; browser->destroystream(_npp_instance, stream, NPRES_USER_BREAK); } @@ -1303,7 +1304,7 @@ do_load_plugin() { //////////////////////////////////////////////////////////////////// void PPInstance:: create_instance() { - if (_p3d_inst != NULL) { + if (_started) { // Already created. return; } @@ -1317,6 +1318,7 @@ create_instance() { if (!_tokens.empty()) { tokens = &_tokens[0]; } + _started = true; _p3d_inst = P3D_new_instance(request_ready, tokens, _tokens.size(), 0, NULL, this); diff --git a/direct/src/plugin_npapi/ppInstance.h b/direct/src/plugin_npapi/ppInstance.h index ee1c137b5e..4582b0d15b 100644 --- a/direct/src/plugin_npapi/ppInstance.h +++ b/direct/src/plugin_npapi/ppInstance.h @@ -117,6 +117,7 @@ private: FileSpec _core_api_dll; bool _failed; + bool _started; bool _got_instance_url; string _instance_url;