mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
keep static device intact (#996)
This commit is contained in:
+2
-2
@@ -121,12 +121,12 @@ pub fn create_savestate(device: &mut device::Device, rewind: bool) {
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let mut error = false;
|
||||
|
||||
if let Ok(mut device_clone) = DEVICE_CLONE.lock()
|
||||
if let Ok(device_clone) = DEVICE_CLONE.lock()
|
||||
&& let Ok(saves_clone) = SAVES_CLONE.lock()
|
||||
{
|
||||
if rewind {
|
||||
let mut state = device::Device::new(false);
|
||||
std::mem::swap(&mut state, &mut *device_clone);
|
||||
state.clone_state(device_clone.deref());
|
||||
if let Ok(mut pool) = rewind_pool.lock() {
|
||||
pool.push_back(SavestateData {
|
||||
device: state,
|
||||
|
||||
Reference in New Issue
Block a user