[qt/qt/qt5compat]: Summary of bulk changes made
KDE Git Services - Bulk Change <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git repository change summary for qt/qt/qt5compat Pushed by mirror-service into branch '6.11'. Changed from 9cfeaa6d90f7c48ce7cfc96d88673076621a6b11 to 569c692ffc847d53b3e01315265954fc2a3403b8 Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository. This change contains the following new commits: Git commit d77dc44656183a9a9b38acc7a62479078bdcf890 by Qt Submodule Update Bot on 17/08/2026 at 08:08.. Update dependencies on '6.11' in qt/qt5compat Change-Id: Ib9af18913c0d442a2ee1a03d6d52f914f0b48638 Reviewed-by: Qt Submodule Update Bot <[email protected]> https://invent.kde.org/qt/qt/qt5compat/-/commit/d77dc44656183a9a9b38acc7a62479078bdcf890 Git commit 569c692ffc847d53b3e01315265954fc2a3403b8 by Qt Cherry-pick Bot (on behalf of Ivan Solovev) on 17/08/2026 at 09:13.. Fix memleak in QBinaryJson::to{Raw,Binary}Data() In Qt 5, the code belonged to QJsonDocument, and the memory was managed by QJsonDocumentPrivate, which correctly cleaned it up in the d-tor. However, when moved to Qt5Compat in Qt 6, the code simply became a namespace with a bunch of free functions, so the underlying d-ptr is gone. As a result, QBinaryJson::toRawData() simply hands a pointer to the user, and it's now their responsibility to free the memory. In case of QBinaryJson::toBinaryData(), the pointer is used to construct a QByteArray (which did another copy), and was never freed afterwards. That's a memory leak on the Qt side. This patch fixes the memleak in QBinaryJson::toBinaryData(), and also documents that the user has to free the memory obtained from QBinaryJson::toRawData(). It also adds a qWarning() to the toRawData() function, to steer the users towards toBinaryData() usage. A follow-up patch will deprecate toRawData() immediately in 6.12. Since toRawData() was used in toBinaryData() implementation, the patch introduces a new static toRawDataHelper() that actually contains all the logic. The tests are also fixed to avoid memory leaks. Amends the introduction of the code in Qt5Compat repo (Qt 6.0). Fixes: QTBUG-149054 Pick-to: 6.8 6.5 Change-Id: If376d19f9788c753e29fd237abf7849307491504 Reviewed-by: Thiago Macieira <[email protected]> (cherry picked from commit 82604842849a66554baac66ef4f4a4469f62d848) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit 86ef784660eaa1f99675b988ad4d159018a71fee) https://invent.kde.org/qt/qt/qt5compat/-/commit/569c692ffc847d53b3e01315265954fc2a3403b8