[vlc-commits] [Git][videolan/vlc][master] qt: use DialogsProvider::getInstance(m_intf) for exit

Marvin Scholz (@ePirat) gitlab at videolan.org
Fri Jul 11 14:20:31 UTC 2025



Marvin Scholz pushed to branch master at VideoLAN / VLC


Commits:
6ff8e88c by Alexandre Janniaux at 2025-07-11T14:02:52+00:00
qt: use DialogsProvider::getInstance(m_intf) for exit

On KDE Plasma, the QuitSpy is triggered without the DialogsProvider
being initialized, which triggers the assertion in DialogsProvider
getInstance() method.

	vlc: ../../../../modules/gui/qt/dialogs/dialogs_provider.hpp:101:
	static DialogsProvider* DialogsProvider::getInstance(): Assertion `instance' failed.

We can provide the p_intf ourselves at initialization, but we need to
make sure it's correctly destroyed afterwards. Since it's destroyed
afterwards in ThreadCleanup, this will be correctly deallocated.

Fixes #29205

- - - - -


1 changed file:

- modules/gui/qt/qt.cpp


Changes:

=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -925,8 +925,10 @@ static void *Thread( void *obj )
      * destroyed. */
     class QuitSpy : public QObject
     {
+        qt_intf_t *m_intf;
     public:
-        QuitSpy(QObject *parent) : QObject(parent)
+        QuitSpy(QObject *parent, qt_intf_t *intf)
+             : QObject(parent), m_intf(intf)
         {
             qGuiApp->installEventFilter(this);
         }
@@ -935,13 +937,13 @@ static void *Thread( void *obj )
             (void)o;
             if (e->type() == QEvent::Quit)
             {
-                THEDP->quit();
+             DialogsProvider::getInstance(m_intf)->quit();
                 return true;
             }
             return false;
         }
     };
-    QuitSpy quitSpy(&app);
+    QuitSpy quitSpy(&app, p_intf);
 
     registerMetaTypes();
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6ff8e88c6db22cb4e3e23ea8c021b7caa733752a

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


VideoLAN code repository instance


More information about the vlc-commits mailing list