X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.h;h=95dfae78e3ae060eaf7745c041275d8a5a97a11b;hb=9e95c15a6754fa571199c36d73ac2dc1d45e5c64;hp=9408436ae6e1e1e8a62f7f98fd62144a715d1202;hpb=1f701edba5013eedf60558b568b3c72ab81a2c08;p=pkanalytics diff --git a/mainwindow.h b/mainwindow.h index 9408436..95dfae7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -16,6 +16,11 @@ class MainWindow : public QMainWindow public: MainWindow(EventsModel *events, PlayersModel *players, FormationsModel *offensive_formations, FormationsModel *defensive_formations); + ~MainWindow() { + if (ui && ui->video) { + ui->video->stop(); + } + } private: void position_changed(uint64_t pos); @@ -39,7 +44,6 @@ private: FormationsModel *offensive_formations; FormationsModel *defensive_formations; bool seeking = false; - bool playing = true; + std::atomic playing{true}; std::optional buffered_seek; - QMediaPlayer *video; };