The previous commit was not sufficient as getIconsSet() returns a
reference to the SearchSet and it could then be used after the
mutex had been unlocked and while it was being modified in
initIconsSet() called in another thread.
When using the mouse wheel (scroll up/down) in the Grid view, item tray for a selected game, ScummVM would exit
I didn't notice any side-effects from the fix, but someone more familiar with the code should confirm.
The crash was not systematic but occured in the case where adding
the game did not change the indexes for the first and last visible
items. The issue was that in setEntryList() was called it did not
cleat the _visibleEntryList array that still contained dangling
pointers to the old items in the _dataEntryList. In most cases
the _visibleEntryList would be updated with pointers to the new
items when calcVisibleEntries() was called from reflowLayout(),
before being used in assignEntriesToItems() (also called from
reflowLayout()). But if the indexes of the first and last visible
items did not change, _visibleEntryList was not updated and we
got a crash in assignEntriesToItems() when trying to access freed
memory.
Strip formatting from the list widget string before taking the length of
it to calculate the caret position. This can be seen e.g. in the save
dialog when not using the icon view.
The tray position was not correctly computed and it was most of the
time trying to display it way outside the window (it was using X
instead of Y in one place for the vertical position).
This was a recent regression from a6bc1d587 (GUI: Fixed grid view
for long games list).
We used Common::Rect which uses in16 for its members. Lomger lists
exceeded 32,768 in heights, thus, leading to negative numbers. As a result,
scrollbar was not showing up.
Fix bug https://bugs.scummvm.org/ticket/13339
Solution is taken from our ListWidget (gui/widgets/list.cpp) which performs a similar check in its ListWidget::getEditRect()
This happened after calling scaleGfx if the original surface was
already at the correct size. In such a case scaleGfx returns the
original surface, so it should not be freed.
Apple's desktop operating system was formerly called "Mac OS X" and "OS X", but since 2016 it has been called "macOS" (starting with version 10.12).
Changing across all comments and documentation to use this current terminology, except in cases where the historical versions are explicitly referenced. No code changes are made; we should consider changing those in future PRs.