ubports / ubuntu-ui-toolkit

Moved to https://gitlab.com/ubports/core/lomiri-ui-toolkit
https://gitlab.com/ubports/core/lomiri-ui-toolkit
GNU Lesser General Public License v3.0
13 stars 21 forks source link

Connect QObject::destroyed() directly #76

Closed UniversalSuperBox closed 4 years ago

UniversalSuperBox commented 4 years ago

QObject::destroyed() is NEVER safe to connect with a queued connection. It's possible that an object is destroyed before its clients have the chance to act on the destroyed signal, resulting in keeping a dangling pointer.

In this case, this signal being connected incorrectly caused crashing on compositor restarts in Lomiri. This may have been the only time where a texture provider could be deleted before its clients. If it wasn't, though, this fix will be a good stability boost elsewhere.