]> uap-core.de Git - uwplayer.git/commitdiff
destroy player on exit
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Fri, 14 Jan 2022 10:45:42 +0000 (11:45 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Fri, 14 Jan 2022 10:45:42 +0000 (11:45 +0100)
application/window.c
application/window.h

index e5fc8150867faa329301b1c6e8ccfc58c334e8a1..dd8700c10fc71593fa3a87f412cde7ffa5e379d5 100644 (file)
@@ -38,6 +38,7 @@ static void FileOpenCB(Widget w, void *udata, void *cdata);
 static void ViewFullscreenCB(Widget w, void *udata, void *cdata);
 
 static void window_close_handler(Widget window, void *udata, void *cdata) {
+    WindowClosePlayer(main_window);
     ApplicationExit();
 }
 
@@ -364,3 +365,10 @@ void WindowAdjustAspectRatio(MainWindow *win) {
     hints.max_aspect.y = new_height;
     XSetWMNormalHints(XtDisplay(win->window), XtWindow(win->window), &hints);
 }
+
+void WindowClosePlayer(MainWindow *win) {
+    if(win->player) {
+        PlayerDestroy(win->player);
+    }
+    win->player = NULL;
+}
index d3e862382d0853d1f322104a6ac9614dd113ef5c..402b6ed10e7e3648cf535e0f35081e096572014e 100644 (file)
@@ -68,6 +68,8 @@ void WindowMenubarSetVisible(MainWindow *win, bool visible);
 
 void WindowAdjustAspectRatio(MainWindow *win);
 
+void WindowClosePlayer(MainWindow *win);
+
 #ifdef __cplusplus
 }
 #endif