mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
Qt: add mutex to game list creation
should prevent random crashes when accessing maps
This commit is contained in:
parent
63a0b97dd1
commit
89a2d04f96
1 changed files with 7 additions and 0 deletions
|
@ -449,6 +449,8 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
|
|||
|
||||
QSet<QString> serials;
|
||||
|
||||
QMutex mutex_cat;
|
||||
|
||||
QList<size_t> indices;
|
||||
for (size_t i = 0; i < path_list.size(); ++i)
|
||||
indices.append(i);
|
||||
|
@ -482,9 +484,12 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
|
|||
game.bootable = psf::get_integer(psf, "BOOTABLE", 0);
|
||||
game.attr = psf::get_integer(psf, "ATTRIBUTE", 0);
|
||||
|
||||
mutex_cat.lock();
|
||||
|
||||
// Detect duplication
|
||||
if (!serial_cat_name[game.serial].emplace(game.category + game.name).second)
|
||||
{
|
||||
mutex_cat.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -514,6 +519,8 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
|
|||
game.category = sstr(category::other);
|
||||
}
|
||||
|
||||
mutex_cat.unlock();
|
||||
|
||||
// Load ICON0.PNG
|
||||
QPixmap icon;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue