mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
[PR #845] [MERGED] Fix issues with a -resume parameter #160
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stenzek/duckstation/pull/845
Author: @CookiePLMonster
Created: 9/12/2020
Status: ✅ Merged
Merged: 9/13/2020
Merged by: @stenzek
Base:
master← Head:fix-resume📝 Commits (3)
95d5417Fix -resume causing a quiet exit if there is no resume savestatec47dcefPass a SystemBootParameters pointer to QtHostInterface::bootSystem2d90cfcTidy up SystemBootParameters constructors📊 Changes
7 files changed (+33 additions, -43 deletions)
View changed files
📝
src/core/system.cpp(+2 -7)📝
src/core/system.h(+1 -1)📝
src/duckstation-qt/main.cpp(+2 -3)📝
src/duckstation-qt/mainwindow.cpp(+12 -16)📝
src/duckstation-qt/qthostinterface.cpp(+5 -10)📝
src/duckstation-qt/qthostinterface.h(+2 -4)📝
src/frontend-common/common_host_interface.cpp(+9 -2)📄 Description
This PR fixes two issues related to the
-resumeparameter:-resumewas passed and a save state exists would hit an assertion in the copy constructor ofSystemBootParametersbecause an attempt to copy a byte stream pointer was being made. This comes from aninvokeMethodfunction used to marshal the call to a Qt worker thread, which as per Qt rules ends up serializing parameters by value, even if they were passed by reference. As a result,SystemBootParameterswas being copied around, even though it's been clearly designed to be a non-copyable class. I have modifiedbootSystemto operate on astd::shared_ptr<SystemBootParameters>, which avoids any copies on the object itself. It's technically also more correct, because this object does have to be copied around, and thus a shared pointer makes sense.As a nice side-effect of those two changes, I tidied up
SystemBootParametersconstructors to move a string instead of copying it, and also made the object truly non-copyable.Fixes #827
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.