OSDN Git Service

[VM][MZ2800] Fix crash ending of emulation.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 21 Feb 2019 09:38:18 +0000 (18:38 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 21 Feb 2019 09:38:18 +0000 (18:38 +0900)
source/src/vm/mz2800/mz2800.cpp

index 1ced399..9f4b1c8 100644 (file)
@@ -261,6 +261,11 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        for(DEVICE* device = first_device; device; device = device->next_device) {
                device->initialize();
        }
+       for(int drv = 0; drv < USE_HARD_DISK; drv++) {
+               if(!(config.last_hard_disk_path[drv][0] != _T('\0') && FILEIO::IsFileExisting(config.last_hard_disk_path[drv]))) {
+                       create_local_path(config.last_hard_disk_path[drv], _MAX_PATH, _T("SASI%d.DAT"), drv);
+               }
+       }
 }
 
 VM::~VM()
@@ -272,11 +277,6 @@ VM::~VM()
                delete device;
                device = next_device;
        }
-       for(int drv = 0; drv < USE_HARD_DISK; drv++) {
-               if(!(config.last_hard_disk_path[drv][0] != _T('\0') && FILEIO::IsFileExisting(config.last_hard_disk_path[drv]))) {
-                       create_local_path(config.last_hard_disk_path[drv], _MAX_PATH, _T("SASI%d.DAT"), drv);
-               }
-       }
 }
 
 DEVICE* VM::get_device(int id)