Browse Source

still record new frame event if the thread is paused (which is always the case)

Nicolas Cannasse 5 years ago
parent
commit
ead10aab9e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      other/profiler/.vscode/launch.json
  2. 1 1
      src/profile.c

+ 1 - 1
other/profiler/.vscode/launch.json

@@ -10,7 +10,7 @@
 			"type": "hl",
 			"hxml": "profiler.hxml",
 			"cwd": "${workspaceFolder}",
-			"args": ["-out","Profile.json","-debug"],
+			"args": ["--out","Profile.json","--debug"],
 			"preLaunchTask": {
 				"type": "haxe",
 				"args": "active configuration"

+ 1 - 1
src/profile.c

@@ -354,7 +354,7 @@ static void profile_event( int code, vbyte *ptr, int dataLen ) {
 		break;
 	default:
 		if( code < 0 ) return;
-		if( data.profiling_pause || (hl_get_thread()->flags & HL_THREAD_PROFILER_PAUSED) ) return;
+		if( data.profiling_pause || (code != 0 && (hl_get_thread()->flags & HL_THREAD_PROFILER_PAUSED)) ) return;
 		data.profiling_pause++;
 		data.waitLoop = true;
 		while( data.waitLoop ) {}