|
@@ -66,6 +66,15 @@ P3DInstanceManager() {
|
|
|
icc.dwICC = ICC_PROGRESS_CLASS;
|
|
icc.dwICC = ICC_PROGRESS_CLASS;
|
|
|
InitCommonControlsEx(&icc);
|
|
InitCommonControlsEx(&icc);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
|
+ // On Mac or Linux, we'd better ignore SIGPIPE, or this signal will
|
|
|
|
|
+ // shut down the browser if the plugin exits unexpectedly.
|
|
|
|
|
+ struct sigaction ignore;
|
|
|
|
|
+ memset(&ignore, 0, sizeof(ignore));
|
|
|
|
|
+ ignore.sa_handler = SIG_IGN;
|
|
|
|
|
+ sigaction(SIGPIPE, &ignore, &_old_sigpipe);
|
|
|
|
|
+#endif // _WIN32
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -84,6 +93,11 @@ P3DInstanceManager::
|
|
|
_started_notify_thread = false;
|
|
_started_notify_thread = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#ifndef _WIN32
|
|
|
|
|
+ // Restore the original SIGPIPE handler.
|
|
|
|
|
+ sigaction(SIGPIPE, &_old_sigpipe, NULL);
|
|
|
|
|
+#endif // _WIN32
|
|
|
|
|
+
|
|
|
if (_xcontents != NULL) {
|
|
if (_xcontents != NULL) {
|
|
|
delete _xcontents;
|
|
delete _xcontents;
|
|
|
}
|
|
}
|