Merge pull request #5344 from lioncash/move

configure_motion_touch: Prevent use after move in ApplyConfiguration()
This commit is contained in:
Morph 2021-01-14 15:24:03 +08:00 committed by GitHub
commit 980973d83e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,14 +328,13 @@ void ConfigureMotionTouch::ApplyConfiguration() {
std::string touch_engine = ui->touch_provider->currentData().toString().toStdString(); std::string touch_engine = ui->touch_provider->currentData().toString().toStdString();
Common::ParamPackage touch_param{}; Common::ParamPackage touch_param{};
touch_param.Set("engine", std::move(touch_engine));
if (touch_engine == "cemuhookudp") { if (touch_engine == "cemuhookudp") {
touch_param.Set("min_x", min_x); touch_param.Set("min_x", min_x);
touch_param.Set("min_y", min_y); touch_param.Set("min_y", min_y);
touch_param.Set("max_x", max_x); touch_param.Set("max_x", max_x);
touch_param.Set("max_y", max_y); touch_param.Set("max_y", max_y);
} }
touch_param.Set("engine", std::move(touch_engine));
Settings::values.touch_device = touch_param.Serialize(); Settings::values.touch_device = touch_param.Serialize();
Settings::values.use_touch_from_button = ui->touch_from_button_checkbox->isChecked(); Settings::values.use_touch_from_button = ui->touch_from_button_checkbox->isChecked();