summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/osl/w32/signal.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx
index fb0eee0514ee..071df170bd84 100644
--- a/sal/osl/w32/signal.cxx
+++ b/sal/osl/w32/signal.cxx
@@ -18,6 +18,7 @@
*/
#include <sal/config.h>
+#include <config_features.h>
#include <signalshared.hxx>
@@ -42,11 +43,13 @@
namespace
{
long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP);
+
+LPTOP_LEVEL_EXCEPTION_FILTER pPreviousHandler = nullptr;
}
bool onInitSignal()
{
- SetUnhandledExceptionFilter(signalHandlerFunction);
+ pPreviousHandler = SetUnhandledExceptionFilter(signalHandlerFunction);
HMODULE hFaultRep = LoadLibrary( "faultrep.dll" );
if ( hFaultRep )
@@ -62,7 +65,7 @@ bool onInitSignal()
bool onDeInitSignal()
{
- SetUnhandledExceptionFilter(nullptr);
+ SetUnhandledExceptionFilter(pPreviousHandler);
return false;
}
@@ -74,6 +77,13 @@ namespace
long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
{
+#if HAVE_FEATURE_BREAKPAD
+ // we should make sure to call the breakpad handler as
+ // first step when we hit a problem
+ if (pPreviousHandler)
+ pPreviousHandler(lpEP);
+#endif
+
static bool bNested = false;
oslSignalInfo info;