]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Clean up filesystem and bsdsocket emulation earlier.
authorToni Wilen <twilen@winuae.net>
Wed, 18 Jan 2023 17:52:35 +0000 (19:52 +0200)
committerToni Wilen <twilen@winuae.net>
Wed, 18 Jan 2023 17:52:35 +0000 (19:52 +0200)
devices.cpp
filesys.cpp

index 0e8215737f11017cd4848d5b17fa32f1c1c6131c..a7390955746854548203e818b1cd0b0098fb5d4f 100644 (file)
@@ -289,6 +289,12 @@ void virtualdevice_free(void)
 #ifdef WITH_PPC
        // must be first
        uae_ppc_free();
+#endif
+#ifdef FILESYS
+       filesys_cleanup();
+#endif
+#ifdef BSDSOCKET
+       bsdlib_reset();
 #endif
        free_traps();
        sampler_free();
@@ -300,12 +306,6 @@ void virtualdevice_free(void)
 #endif
 #ifdef AUTOCONFIG
        expansion_cleanup();
-#endif
-#ifdef FILESYS
-       filesys_cleanup();
-#endif
-#ifdef BSDSOCKET
-       bsdlib_reset();
 #endif
        device_func_free();
 #ifdef WITH_LUA
index b9c2201b967b41402624d875ca997760aa753a43..318af0085e9ecc098629dbaa2ee944260832313e 100644 (file)
@@ -7356,6 +7356,17 @@ void filesys_free_handles (void)
        }
 }
 
+static void free_shellexecute(void)
+{
+       shell_execute_data = 0;
+       shell_execute_process = 0;
+       shellexecute2_queued = 0;
+       for (int i = 0; i < SHELLEXEC_MAX; i++) {
+               struct ShellExecute2 *se2 = &shellexecute2[i];
+               shellexecute2_free(se2);
+       }
+}
+
 static void filesys_reset2 (void)
 {
        Unit *u, *u1;
@@ -7379,14 +7390,7 @@ void filesys_reset (void)
        load_injected_icons();
        filesys_reset2 ();
        initialize_mountinfo ();
-
-       shell_execute_data = 0;
-       shell_execute_process = 0;
-       shellexecute2_queued = 0;
-       for (int i = 0; i < SHELLEXEC_MAX; i++) {
-               struct ShellExecute2 *se2 = &shellexecute2[i];
-               shellexecute2_free(se2);
-       }
+       free_shellexecute();
 }
 
 static void filesys_prepare_reset2 (void)
@@ -9354,12 +9358,15 @@ void filesys_vsync (void)
 
 void filesys_cleanup(void)
 {
+       filesys_prepare_reset();
+       filesys_reset2();
        filesys_free_handles();
        free_mountinfo();
        destroy_comm_pipe(&shellexecute_pipe);
        uae_sem_destroy(&singlethread_int_sem);
        uae_sem_destroy(&shellexec_sem);
        shell_execute_data = 0;
+       free_shellexecute();
 }
 
 void filesys_install (void)