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:
parent
9fd8a6124e
commit
cb81200582
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user