Skip to content

Commit

Permalink
fix: [io]Memory leak due to failed asynchronous query for file inform…
Browse files Browse the repository at this point in the history
…ation

Memory leak due to failed asynchronous query for file information

Log: Memory leak due to failed asynchronous query for file information
  • Loading branch information
liyigang1 committed Aug 31, 2023
1 parent d1a2550 commit afa7262
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dfm-base/utils/fileinfohelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,16 @@ void FileInfoHelper::fileRefreshAsyncCallBack(bool success, void *userData)
if (!userData)
return;
auto data = static_cast<FileRefreshCallBackData *>(userData);
if (!data->info)
if (!success) {
qWarning() << "Failed to query file information asynchronously! \n" << (data->info ? "" : data->info->fileUrl().toString());
delete data;
return;
}

if (!data->info) {
delete data;
return;
}

FileInfoHelper::instance().cacheFileInfoByThread(data->info);
delete data;
Expand Down

0 comments on commit afa7262

Please sign in to comment.