Browse Source

fix firefox crash

David Rose 16 years ago
parent
commit
10e4427860
2 changed files with 7 additions and 4 deletions
  1. 6 0
      direct/src/plugin/p3dInstance.cxx
  2. 1 4
      direct/src/plugin_npapi/ppInstance.cxx

+ 6 - 0
direct/src/plugin/p3dInstance.cxx

@@ -359,6 +359,12 @@ make_p3d_stream(const string &p3d_url) {
 ////////////////////////////////////////////////////////////////////
 void P3DInstance::
 set_p3d_filename(const string &p3d_filename) {
+  if (!_fparams.get_p3d_filename().empty()) {
+    nout << "p3d_filename already set to: " << _fparams.get_p3d_filename()
+         << ", trying to set to " << p3d_filename << "\n";
+    return;
+  }
+
   _fparams.set_p3d_filename(p3d_filename);
   _got_fparams = true;
 

+ 1 - 4
direct/src/plugin_npapi/ppInstance.cxx

@@ -258,6 +258,7 @@ write_ready(NPStream *stream) {
       // instance.
       assert(_got_instance_url);
       int user_id = P3D_instance_start_stream(_p3d_inst, _instance_url.c_str());
+      nout << "Got p3d instance to stream " << user_id << "\n";
       req->_rtype = PPDownloadRequest::RT_user;
       req->_user_id = user_id;
     }
@@ -1196,10 +1197,6 @@ create_instance() {
       _script_object->set_main(main);
     }
 
-    if (_got_instance_url) {
-      P3D_instance_start(_p3d_inst, false, _instance_url.c_str());
-    }
-
     if (_got_window) {
       send_window();
     }