Explorar el Código

display(iOS): fix crash due to race when re-sizing while a view is being destroyed

osy hace 1 año
padre
commit
8ea2fb430e
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      Platform/iOS/VMDisplayHostedView.swift

+ 5 - 5
Platform/iOS/VMDisplayHostedView.swift

@@ -37,19 +37,19 @@ struct VMDisplayHostedView: UIViewControllerRepresentable {
         }
         
         @MainActor var qemuDisplayUpscaler: MTLSamplerMinMagFilter {
-            vmConfig.displays[state.device!.configIndex].upscalingFilter.metalSamplerMinMagFilter
+            vmConfig.displays[device.configIndex].upscalingFilter.metalSamplerMinMagFilter
         }
         
         @MainActor var qemuDisplayDownscaler: MTLSamplerMinMagFilter {
-            vmConfig.displays[state.device!.configIndex].downscalingFilter.metalSamplerMinMagFilter
+            vmConfig.displays[device.configIndex].downscalingFilter.metalSamplerMinMagFilter
         }
         
         @MainActor var qemuDisplayIsDynamicResolution: Bool {
-            vmConfig.displays[state.device!.configIndex].isDynamicResolution
+            vmConfig.displays[device.configIndex].isDynamicResolution
         }
         
         @MainActor var qemuDisplayIsNativeResolution: Bool {
-            vmConfig.displays[state.device!.configIndex].isNativeResolution
+            vmConfig.displays[device.configIndex].isNativeResolution
         }
         
         @MainActor var qemuHasClipboardSharing: Bool {
@@ -57,7 +57,7 @@ struct VMDisplayHostedView: UIViewControllerRepresentable {
         }
         
         @MainActor var qemuConsoleResizeCommand: String? {
-            vmConfig.serials[state.device!.configIndex].terminal?.resizeCommand
+            vmConfig.serials[device.configIndex].terminal?.resizeCommand
         }
         
         var isViewportChanged: Bool {