← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2603: crash logger fixes

 

Merge authors:
  poy (poy)
------------------------------------------------------------
revno: 2603 [merge]
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2011-08-27 19:08:22 +0200
message:
  crash logger fixes
modified:
  win32/CrashLogger.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/CrashLogger.cpp'
--- win32/CrashLogger.cpp	2011-07-03 16:15:56 +0000
+++ win32/CrashLogger.cpp	2011-08-27 12:12:50 +0000
@@ -345,12 +345,11 @@
 								}
 
 								function += ')';
-
-								if(spec_die) {
-									dwarf_dealloc(dbg, spec_die, DW_DLA_DIE);
-								}
-							}
-
+							}
+
+							if(spec_die) {
+								dwarf_dealloc(dbg, spec_die, DW_DLA_DIE);
+							}
 							dwarf_dealloc(dbg, die, DW_DLA_DIE);
 						}
 
@@ -447,8 +446,7 @@
 
 #ifndef NO_BACKTRACE
 
-inline void writeBacktrace(LPCONTEXT context)
-{
+inline void writeBacktrace(LPCONTEXT context) {
 	HANDLE const process = GetCurrentProcess();
 	HANDLE const thread = GetCurrentThread();
 
@@ -552,8 +550,12 @@
 
 #endif // NO_BACKTRACE
 
-LONG WINAPI exception_filter(LPEXCEPTION_POINTERS info)
-{
+LONG WINAPI exceptionFilter(LPEXCEPTION_POINTERS info) {
+	if(f) {
+		// only log the first exception.
+		return EXCEPTION_CONTINUE_EXECUTION;
+	}
+
 	f = fopen(CrashLogger::getPath().c_str(), "w");
 	if(f) {
 		writeAppInfo();
@@ -580,7 +582,7 @@
 } // unnamed namespace
 
 CrashLogger::CrashLogger() {
-	prevFilter = SetUnhandledExceptionFilter(exception_filter);
+	prevFilter = SetUnhandledExceptionFilter(exceptionFilter);
 }
 
 CrashLogger::~CrashLogger() {