From: Olaf Wintermann Date: Fri, 14 Jan 2022 10:45:42 +0000 (+0100) Subject: destroy player on exit X-Git-Url: https://develop.uap-core.de/gitweb/uwplayer.git/commitdiff_plain/1ece1247ff8ccb11bc2090f0218a037d28a6598f destroy player on exit --- diff --git a/application/window.c b/application/window.c index e5fc815..dd8700c 100644 --- a/application/window.c +++ b/application/window.c @@ -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; +} diff --git a/application/window.h b/application/window.h index d3e8623..402b6ed 100644 --- a/application/window.h +++ b/application/window.h @@ -68,6 +68,8 @@ void WindowMenubarSetVisible(MainWindow *win, bool visible); void WindowAdjustAspectRatio(MainWindow *win); +void WindowClosePlayer(MainWindow *win); + #ifdef __cplusplus } #endif