[vlc-commits] [Git][videolan/vlc][master] qt: fix `MainUI::clearQMLTypes()` is not called

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Apr 1 09:13:21 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ff8c4aa9 by Fatih Uzunoglu at 2026-04-01T08:47:09+00:00
qt: fix `MainUI::clearQMLTypes()` is not called

In 643b5a27, I made a mistake by connecting the
`destroyed()` signal into an object (`MainUI`)
that is dying. Naturally since the receiver is
dead, by the time destructor returns, the slot
is not going to be called because the connection
would cease to exist.

This fixes assertion failure if `MainInterface.qml`
could not be loaded or compositor failed to
initialize for another reason and another one
is being tried.

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/maininterface/mainui.cpp
=====================================
@@ -133,7 +133,7 @@ MainUI::~MainUI()
     {
         // `QObject::destroyed()` is signalled just before the object dies, but subclass `QQmlEngine`
         // itself should be dead at that point anyway. This should prevent undefined behavior.
-        connect(m_engineBound, &QObject::destroyed, this, &MainUI::clearQMLTypes, Qt::UniqueConnection);
+        connect(m_engineBound, &QObject::destroyed, &MainUI::clearQMLTypes);
     }
 }
 


=====================================
modules/gui/qt/maininterface/mainui.hpp
=====================================
@@ -30,7 +30,7 @@ public:
 
 private:
     void registerQMLTypes();
-    /*static*/ void clearQMLTypes();
+    static void clearQMLTypes();
     static QObject* getMainCtxInstance(QQmlEngine *, QJSEngine *);
 
     qt_intf_t* m_intf = nullptr;



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

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




More information about the vlc-commits mailing list