mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-29 21:44:50 +00:00
savedata dialog: fix SaveDialogUi move semantics
fix possible dangling points
This commit is contained in:
parent
0ba9ea6a3b
commit
3607393eb2
@ -345,12 +345,15 @@ SaveDialogUi::SaveDialogUi(SaveDialogUi&& other) noexcept
|
||||
}
|
||||
}
|
||||
|
||||
SaveDialogUi& SaveDialogUi::operator=(SaveDialogUi other) {
|
||||
SaveDialogUi& SaveDialogUi::operator=(SaveDialogUi&& other) noexcept {
|
||||
std::scoped_lock lock(draw_mutex, other.draw_mutex);
|
||||
using std::swap;
|
||||
swap(state, other.state);
|
||||
swap(status, other.status);
|
||||
swap(result, other.result);
|
||||
state = other.state;
|
||||
other.state = nullptr;
|
||||
status = other.status;
|
||||
other.status = nullptr;
|
||||
result = other.result;
|
||||
other.result = nullptr;
|
||||
if (status && *status == Status::RUNNING) {
|
||||
first_render = true;
|
||||
AddLayer(this);
|
||||
|
@ -300,7 +300,8 @@ public:
|
||||
~SaveDialogUi() override;
|
||||
SaveDialogUi(const SaveDialogUi& other) = delete;
|
||||
SaveDialogUi(SaveDialogUi&& other) noexcept;
|
||||
SaveDialogUi& operator=(SaveDialogUi other);
|
||||
SaveDialogUi& operator=(SaveDialogUi& other) = delete;
|
||||
SaveDialogUi& operator=(SaveDialogUi&& other) noexcept;
|
||||
|
||||
void Finish(ButtonId buttonId, CommonDialog::Result r = CommonDialog::Result::OK);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user