Browse Source

Better emscripten error handling - mainloop stops when debugger triggered.

Mark Sibly 7 years ago
parent
commit
45d46485fa
1 changed files with 8 additions and 0 deletions
  1. 8 0
      modules/monkey/native/bbdebug.cpp

+ 8 - 0
modules/monkey/native/bbdebug.cpp

@@ -10,6 +10,10 @@
 
 
 #include <signal.h>
 #include <signal.h>
 
 
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
 typedef void(*dbEmit_t)(void*);
 typedef void(*dbEmit_t)(void*);
 
 
 namespace bbDB{
 namespace bbDB{
@@ -130,6 +134,10 @@ namespace bbDB{
 		bb_printf( "\n" );
 		bb_printf( "\n" );
 		fflush( stdout );
 		fflush( stdout );
 		
 		
+#ifdef __EMSCRIPTEN__
+		emscripten_pause_main_loop();
+#endif
+		
 		for(;;){
 		for(;;){
 		
 		
 			char buf[256];
 			char buf[256];