2
0
Эх сурвалжийг харах

Raise App Terminate event on SIGTERM.

woollybah 6 жил өмнө
parent
commit
377b2f8580

+ 10 - 1
systemdefault.mod/system.linux.c

@@ -101,9 +101,18 @@ void bbSystemShutdown(){
 //	XCloseDisplay(x_display);	causes crash with fltk canvas usage
 }
 
+void bbAppTerminate(int signum) {
+    bbSystemEmitEvent( BBEVENT_APPTERMINATE,&bbNullObject,0,0,0,0,&bbNullObject );
+}
+
 void bbSystemStartup(){
 	atexit( bbSystemShutdown );
-	
+
+	struct sigaction action;
+    memset(&action, 0, sizeof(struct sigaction));
+    action.sa_handler = bbAppTerminate;
+    sigaction(SIGTERM, &action, NULL);
+
 	XInitThreads();
 	
 	x_display=XOpenDisplay(0);