From 00c004fdc6ca44281a69d7fe740f648c2b286148 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Mon, 28 Nov 2022 08:50:57 +0900 Subject: [PATCH] Remove init() to reduce starting up time Signed-off-by: Akihiro Suda --- virtualization.go | 4 ---- virtualization_12.h | 1 - virtualization_12.m | 6 +----- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/virtualization.go b/virtualization.go index 9b95df7..0c69440 100644 --- a/virtualization.go +++ b/virtualization.go @@ -16,10 +16,6 @@ import ( "github.com/Code-Hex/vz/v3/internal/objc" ) -func init() { - C.sharedApplication() -} - // VirtualMachineState represents execution state of the virtual machine. // //go:generate stringer -type=VirtualMachineState diff --git a/virtualization_12.h b/virtualization_12.h index 0623c5c..961f4c3 100644 --- a/virtualization_12.h +++ b/virtualization_12.h @@ -44,5 +44,4 @@ void setKeyboardsVZVirtualMachineConfiguration(void *config, void setAudioDevicesVZVirtualMachineConfiguration(void *config, void *audioDevices); -void sharedApplication(); void startVirtualMachineWindow(void *machine, double width, double height); \ No newline at end of file diff --git a/virtualization_12.m b/virtualization_12.m index 567172b..efbfef4 100644 --- a/virtualization_12.m +++ b/virtualization_12.m @@ -318,16 +318,12 @@ void setVZVirtioFileSystemDeviceConfigurationShare(void *config, void *share) RAISE_UNSUPPORTED_MACOS_EXCEPTION(); } -void sharedApplication() +void startVirtualMachineWindow(void *machine, double width, double height) { // Create a shared app instance. // This will initialize the global variable // 'NSApp' with the application instance. [VZApplication sharedApplication]; -} - -void startVirtualMachineWindow(void *machine, double width, double height) -{ if (@available(macOS 12, *)) { @autoreleasepool { AppDelegate *appDelegate = [[[AppDelegate alloc]