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

Fix use after free on file received

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-08-28 20:20:28 +02:00
parent 74e9d7a4f5
commit 56edd76df9

View File

@ -337,9 +337,9 @@ void Core::onFileControlCallback(Tox* tox, int32_t friendnumber, uint8_t receive
.arg(file->fileNum).arg(file->friendId);
file->status = ToxFile::STOPPED;
emit static_cast<Core*>(core)->fileTransferFinished(*file);
removeFileFromQueue((bool)receive_send, file->friendId, file->fileNum);
// confirm receive is complete
tox_file_send_control(tox, file->friendId, 0, file->fileNum, TOX_FILECONTROL_FINISHED, nullptr, 0);
removeFileFromQueue((bool)receive_send, file->friendId, file->fileNum);
}
else
{