Skip to content

Commit

Permalink
Merge pull request #115 from AkihiroSuda/remove-init
Browse files Browse the repository at this point in the history
Remove init() to reduce starting up time
  • Loading branch information
Code-Hex committed Nov 28, 2022
2 parents 1c3cfbc + 00c004f commit 23eeede
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
4 changes: 0 additions & 4 deletions virtualization.go
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion virtualization_12.h
Expand Up @@ -44,5 +44,4 @@ void setKeyboardsVZVirtualMachineConfiguration(void *config,
void setAudioDevicesVZVirtualMachineConfiguration(void *config,
void *audioDevices);

void sharedApplication();
void startVirtualMachineWindow(void *machine, double width, double height);
6 changes: 1 addition & 5 deletions virtualization_12.m
Expand Up @@ -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]
Expand Down

0 comments on commit 23eeede

Please sign in to comment.