Browse Source

Sig handler: do not dump on non-hl thread

Yuxiao Mao 1 month ago
parent
commit
c7bb8d5cfc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/main.c

+ 3 - 1
src/main.c

@@ -114,7 +114,9 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
 static void handle_signal( int signum ) {
 	signal(signum, SIG_DFL);
 	printf("SIGNAL %d\n",signum);
-	hl_dump_stack();
+	if( hl_get_thread() != NULL ) {
+		hl_dump_stack();
+	}
 	fflush(stdout);
 	raise(signum);
 }