Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
826ae377 by Fatih Uzunoglu at 2025-03-25T06:13:35+00:00
qt: fix missing disconnect in `VideoSurface`

- - - - -


2 changed files:

- modules/gui/qt/maininterface/videosurface.cpp
- modules/gui/qt/maininterface/videosurface.hpp


Changes:

=====================================
modules/gui/qt/maininterface/videosurface.cpp
=====================================
@@ -337,7 +337,7 @@ QSGNode *VideoSurface::updatePaintNode(QSGNode *node, 
UpdatePaintNodeData *data)
     if (w != m_oldWindow)
     {
         if (m_oldWindow)
-            disconnect(m_oldWindow, &QQuickWindow::afterRendering, this, 
&VideoSurface::synchronize);
+            disconnect(m_synchConnection);
 
         m_oldWindow = w;
 
@@ -347,11 +347,11 @@ QSGNode *VideoSurface::updatePaintNode(QSGNode *node, 
UpdatePaintNodeData *data)
             if (m_provider->supportsThreadedSurfaceUpdates())
             {
                 // Synchronize just before swapping the frame for better 
synchronization:
-                connect(w, &QQuickWindow::afterRendering, this, 
&VideoSurface::synchronize, Qt::DirectConnection);
+                m_synchConnection = connect(w, &QQuickWindow::afterRendering, 
this, &VideoSurface::synchronize, Qt::DirectConnection);
             }
             else
             {
-                connect(w, &QQuickWindow::afterAnimating, this, 
&VideoSurface::synchronize);
+                m_synchConnection = connect(w, &QQuickWindow::afterAnimating, 
this, &VideoSurface::synchronize);
             }
         }
     }


=====================================
modules/gui/qt/maininterface/videosurface.hpp
=====================================
@@ -131,6 +131,7 @@ private:
     QPointer<VideoSurfaceProvider> m_provider;
 
     QPointer<QQuickWindow> m_oldWindow;
+    QMetaObject::Connection m_synchConnection;
 
     // This is updated and read from different threads, but during 
synchronization stage so explicit synchronization
     // such as atomic boolean or locking is not necessary:



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/826ae377480fca0886defe7f752806d9ea7b81dd

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/826ae377480fca0886defe7f752806d9ea7b81dd
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to