1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix leak, enable NRVO in Core::getStatusMessage

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-10-26 21:33:24 +01:00
parent 9fd8a6124e
commit cb81200582
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -1016,13 +1016,13 @@ QString Core::getIDString()
QString Core::getStatusMessage()
{
QString sname;
int size = tox_get_self_status_message_size(tox);
uint8_t* name = new uint8_t[size];
if (tox_get_self_status_message(tox, name, size) == size)
return QString(CString::toString(name, size));
else
return QString();
sname = CString::toString(name, size);
delete[] name;
return sname;
}
void Core::setStatusMessage(const QString& message)