mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 17:58:37 +12: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;
|
QSet<QString> serials;
|
||||||
|
|
||||||
|
QMutex mutex_cat;
|
||||||
|
|
||||||
QList<size_t> indices;
|
QList<size_t> indices;
|
||||||
for (size_t i = 0; i < path_list.size(); ++i)
|
for (size_t i = 0; i < path_list.size(); ++i)
|
||||||
indices.append(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.bootable = psf::get_integer(psf, "BOOTABLE", 0);
|
||||||
game.attr = psf::get_integer(psf, "ATTRIBUTE", 0);
|
game.attr = psf::get_integer(psf, "ATTRIBUTE", 0);
|
||||||
|
|
||||||
|
mutex_cat.lock();
|
||||||
|
|
||||||
// Detect duplication
|
// Detect duplication
|
||||||
if (!serial_cat_name[game.serial].emplace(game.category + game.name).second)
|
if (!serial_cat_name[game.serial].emplace(game.category + game.name).second)
|
||||||
{
|
{
|
||||||
|
mutex_cat.unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,6 +519,8 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
|
||||||
game.category = sstr(category::other);
|
game.category = sstr(category::other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_cat.unlock();
|
||||||
|
|
||||||
// Load ICON0.PNG
|
// Load ICON0.PNG
|
||||||
QPixmap icon;
|
QPixmap icon;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue