[vlc-commits] qt: fix release order in Win7 Compositor

Pierre Lamot git at videolan.org
Thu Oct 29 09:08:26 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Oct 22 10:28:03 2020 +0200| [4394ce475a11bdeaa2aff045aeb1b89cd8dbb8c3] | committer: Pierre Lamot

qt: fix release order in Win7 Compositor

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4394ce475a11bdeaa2aff045aeb1b89cd8dbb8c3
---

 modules/gui/qt/maininterface/compositor_win7.cpp | 15 ++++++++++++++-
 modules/gui/qt/maininterface/compositor_win7.hpp |  6 +++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/maininterface/compositor_win7.cpp b/modules/gui/qt/maininterface/compositor_win7.cpp
index 55d6f54a1b..c7ee0e2f9b 100644
--- a/modules/gui/qt/maininterface/compositor_win7.cpp
+++ b/modules/gui/qt/maininterface/compositor_win7.cpp
@@ -78,7 +78,8 @@ void CompositorWin7::window_set_fullscreen(struct vout_window_t * p_wnd, const c
 
 
 CompositorWin7::CompositorWin7(intf_thread_t *p_intf, QObject* parent)
-    : CompositorDummy(p_intf, parent)
+    : QObject(parent)
+    , m_intf(p_intf)
 {
 }
 
@@ -216,6 +217,18 @@ MainInterface* CompositorWin7::makeMainInterface()
     return m_rootWindow;
 }
 
+void CompositorWin7::destroyMainInterface()
+{
+    m_qmlVideoSurfaceProvider.reset();
+    m_videoWindowHandler.reset();
+    m_qmlView.reset();
+    if (m_rootWindow)
+    {
+        delete m_rootWindow;
+        m_rootWindow = nullptr;
+    }
+}
+
 bool CompositorWin7::setupVoutWindow(vout_window_t *p_wnd)
 {
     BOOL isCompositionEnabled;
diff --git a/modules/gui/qt/maininterface/compositor_win7.hpp b/modules/gui/qt/maininterface/compositor_win7.hpp
index a62650dc8b..86e8cd225a 100644
--- a/modules/gui/qt/maininterface/compositor_win7.hpp
+++ b/modules/gui/qt/maininterface/compositor_win7.hpp
@@ -38,7 +38,7 @@ signals:
     void windowStyleChanged();
 };
 
-class CompositorWin7 : public CompositorDummy
+class CompositorWin7 : public QObject, public Compositor
 {
     Q_OBJECT
 public:
@@ -49,6 +49,7 @@ public:
     bool init();
 
     virtual MainInterface *makeMainInterface() override;
+    virtual void destroyMainInterface() override;
     virtual bool setupVoutWindow(vout_window_t*) override;
 
 protected:
@@ -67,6 +68,9 @@ private slots:
     void resetVideoZOrder();
 
 private:
+    intf_thread_t *m_intf = nullptr;
+
+    MainInterface* m_rootWindow = nullptr;
     QWidget* m_stable = nullptr;
     std::unique_ptr<QQuickView> m_qmlView;
     std::unique_ptr<VideoWindowHandler> m_videoWindowHandler;



More information about the vlc-commits mailing list