QDBusSignature: fix default ctor to not allocate memory
The QDBusSignature default ctor is noexcept since 49f7281d36028055e61175c23bc455b4147480b9 (Qt 5.5-ish), so detach() (which must needs allocate memory) cannot be used without breaking the contract. Fix by assigning ""_L1 instead, the canonical way to access the shared empty state. While fromLatin1() isn't noexcept, fromLatin1(""_L1) never throws. Amends ed6d1fa71a79a70b7e6a20fbbc737ed9f6c287b1. Pick-to: 6.7 6.5 Task-number: QTBUG-124919 Change-Id: I5f0c3bdc199998deaa22971a60388f8f3ed0eaa8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 11dbf821942dbda6e53d7bfcf378904318634196) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5910dd7fe0
commit
9cc1825c0b
@ -78,9 +78,8 @@ class Q_DBUS_EXPORT QDBusSignature
|
||||
QString m_signature;
|
||||
public:
|
||||
QDBusSignature() noexcept
|
||||
{
|
||||
m_signature.detach(); // mark non-null (empty signatures are valid)
|
||||
}
|
||||
: m_signature(QLatin1StringView("")) // mark non-null (empty signatures are valid)
|
||||
{}
|
||||
// compiler-generated copy/move constructor/assignment operators are ok!
|
||||
// compiler-generated destructor is ok!
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user