Fixing bug in debugger sending wrong tick with values
authorlaurent
Sat, 31 Mar 2012 15:10:55 +0200
changeset 709 fe65601bd983
parent 708 6ec28dc375cf
child 710 d76f73c7ae5e
Fixing bug in debugger sending wrong tick with values
targets/Win32/plc_Win32_main.c
--- a/targets/Win32/plc_Win32_main.c	Sat Mar 31 15:09:48 2012 +0200
+++ b/targets/Win32/plc_Win32_main.c	Sat Mar 31 15:10:55 2012 +0200
@@ -169,9 +169,11 @@
 /* from plc_debugger.c */
 int WaitDebugData(unsigned long *tick)
 {
+	DWORD res;
+	res = WaitForSingleObject(debug_wait_sem, INFINITE);
     *tick = __debug_tick;
     /* Wait signal from PLC thread */
-	return WaitForSingleObject(debug_wait_sem, INFINITE) != WAIT_OBJECT_0;
+	return res != WAIT_OBJECT_0;
 }
 
 /* Called by PLC thread when debug_publish finished