瀏覽代碼

fix splash window when crash at startup

David Rose 16 年之前
父節點
當前提交
3f2f1f4877
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 4 2
      direct/src/plugin_npapi/ppInstance.cxx
  2. 1 0
      direct/src/plugin_npapi/ppInstance.h

+ 4 - 2
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);
 

+ 1 - 0
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;