I got crashes when saving Savegames on Windows in rend_Screenshot() that are introduced with 80c207d.
The auto screenshot in the beginning of that function is a std::unique_ptr<NewBitmap>. The following auto *temp_data is a raw pointer to NewBitmap::_data which itself is a std::unique_ptr. So the mem_free(temp_data) at the end of that function was freeing the memory held by _data and the auto screenshot going out of scope after that, was trying to delete that memory again through the dtor of the std::unique_ptr.
Related Issues
Screenshots (if applicable)
Checklist
[x] I have tested my changes locally and verified that they work as intended.
[x] I have documented any new or modified functionality.
[x] I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
[x] I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.
Pull Request Type
Description
I got crashes when saving Savegames on Windows in rend_Screenshot() that are introduced with 80c207d.
The
auto screenshot
in the beginning of that function is astd::unique_ptr<NewBitmap>
. The followingauto *temp_data
is a raw pointer toNewBitmap::_data
which itself is a std::unique_ptr. So themem_free(temp_data)
at the end of that function was freeing the memory held by_data
and theauto screenshot
going out of scope after that, was trying to delete that memory again through the dtor of the std::unique_ptr.Related Issues
Screenshots (if applicable)
Checklist
Additional Comments