mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-30 14:04:55 +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);
|
std::scoped_lock lock(draw_mutex, other.draw_mutex);
|
||||||
using std::swap;
|
using std::swap;
|
||||||
swap(state, other.state);
|
state = other.state;
|
||||||
swap(status, other.status);
|
other.state = nullptr;
|
||||||
swap(result, other.result);
|
status = other.status;
|
||||||
|
other.status = nullptr;
|
||||||
|
result = other.result;
|
||||||
|
other.result = nullptr;
|
||||||
if (status && *status == Status::RUNNING) {
|
if (status && *status == Status::RUNNING) {
|
||||||
first_render = true;
|
first_render = true;
|
||||||
AddLayer(this);
|
AddLayer(this);
|
||||||
|
@ -300,7 +300,8 @@ public:
|
|||||||
~SaveDialogUi() override;
|
~SaveDialogUi() override;
|
||||||
SaveDialogUi(const SaveDialogUi& other) = delete;
|
SaveDialogUi(const SaveDialogUi& other) = delete;
|
||||||
SaveDialogUi(SaveDialogUi&& other) noexcept;
|
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);
|
void Finish(ButtonId buttonId, CommonDialog::Result r = CommonDialog::Result::OK);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user