From f6702b195566c63d24397a29ebb75a549424fbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sat, 3 Aug 2019 13:17:30 +0200 Subject: [PATCH] Stop Session on Window Close --- gui/include/streamwindow.h | 1 + gui/src/streamsession.cpp | 1 + gui/src/streamwindow.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/gui/include/streamwindow.h b/gui/include/streamwindow.h index 2e7fcb4..22e8386 100644 --- a/gui/include/streamwindow.h +++ b/gui/include/streamwindow.h @@ -41,6 +41,7 @@ class StreamWindow: public QMainWindow protected: void keyPressEvent(QKeyEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; + void closeEvent(QCloseEvent *event) override; private slots: void FramesAvailable(); diff --git a/gui/src/streamsession.cpp b/gui/src/streamsession.cpp index 2dae0df..18fa2bd 100644 --- a/gui/src/streamsession.cpp +++ b/gui/src/streamsession.cpp @@ -119,6 +119,7 @@ StreamSession::~StreamSession() void StreamSession::Stop() { + chiaki_session_stop(&session); } void StreamSession::HandleKeyboardEvent(QKeyEvent *event) diff --git a/gui/src/streamwindow.cpp b/gui/src/streamwindow.cpp index 5cf5b53..f08f59b 100644 --- a/gui/src/streamwindow.cpp +++ b/gui/src/streamwindow.cpp @@ -56,6 +56,10 @@ void StreamWindow::keyReleaseEvent(QKeyEvent *event) session->HandleKeyboardEvent(event); } +void StreamWindow::closeEvent(QCloseEvent *event) +{ + session->Stop(); +} void StreamWindow::FramesAvailable() {