mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
sigaction
This commit is contained in:
parent
3329c91dba
commit
25117835e0
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
class P3DInstance;
|
class P3DInstance;
|
||||||
class P3DSession;
|
class P3DSession;
|
||||||
class P3DPackage;
|
class P3DPackage;
|
||||||
@ -135,6 +139,10 @@ private:
|
|||||||
NotifyInstances _notify_instances;
|
NotifyInstances _notify_instances;
|
||||||
P3DConditionVar _notify_ready;
|
P3DConditionVar _notify_ready;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
struct sigaction _old_sigpipe;
|
||||||
|
#endif
|
||||||
|
|
||||||
static P3DInstanceManager *_global_ptr;
|
static P3DInstanceManager *_global_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,10 +21,6 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#include <signal.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static ofstream logfile;
|
static ofstream logfile;
|
||||||
ostream *nout_stream = &logfile;
|
ostream *nout_stream = &logfile;
|
||||||
|
|
||||||
@ -134,12 +130,6 @@ NP_Initialize(NPNetscapeFuncs *browserFuncs,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
// On Mac, we'd better ignore SIGPIPE, or this signal will shut down
|
|
||||||
// the application if the plugin exits unexpectedly.
|
|
||||||
signal(SIGPIPE, SIG_IGN);
|
|
||||||
#endif // __APPLE__
|
|
||||||
|
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1929,7 +1929,8 @@ class Packager:
|
|||||||
if filename:
|
if filename:
|
||||||
newFilename = Filename('/'.join(moduleName.split('.')))
|
newFilename = Filename('/'.join(moduleName.split('.')))
|
||||||
newFilename.setExtension(filename.getExtension())
|
newFilename.setExtension(filename.getExtension())
|
||||||
package.addFile(filename, newName = newFilename.cStr(),
|
self.currentPackage.addFile(
|
||||||
|
filename, newName = newFilename.cStr(),
|
||||||
deleteTemp = True, explicit = True, extract = True)
|
deleteTemp = True, explicit = True, extract = True)
|
||||||
|
|
||||||
self.currentPackage.mainModule = (moduleName, newName)
|
self.currentPackage.mainModule = (moduleName, newName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user