Skip to content

Commit 23eeede

Browse files
authored
Merge pull request #115 from AkihiroSuda/remove-init
Remove init() to reduce starting up time
2 parents 1c3cfbc + 00c004f commit 23eeede

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

virtualization.go

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import (
1616
"github.com/Code-Hex/vz/v3/internal/objc"
1717
)
1818

19-
func init() {
20-
C.sharedApplication()
21-
}
22-
2319
// VirtualMachineState represents execution state of the virtual machine.
2420
//
2521
//go:generate stringer -type=VirtualMachineState

virtualization_12.h

-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ void setKeyboardsVZVirtualMachineConfiguration(void *config,
4444
void setAudioDevicesVZVirtualMachineConfiguration(void *config,
4545
void *audioDevices);
4646

47-
void sharedApplication();
4847
void startVirtualMachineWindow(void *machine, double width, double height);

virtualization_12.m

+1-5
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,12 @@ void setVZVirtioFileSystemDeviceConfigurationShare(void *config, void *share)
318318
RAISE_UNSUPPORTED_MACOS_EXCEPTION();
319319
}
320320

321-
void sharedApplication()
321+
void startVirtualMachineWindow(void *machine, double width, double height)
322322
{
323323
// Create a shared app instance.
324324
// This will initialize the global variable
325325
// 'NSApp' with the application instance.
326326
[VZApplication sharedApplication];
327-
}
328-
329-
void startVirtualMachineWindow(void *machine, double width, double height)
330-
{
331327
if (@available(macOS 12, *)) {
332328
@autoreleasepool {
333329
AppDelegate *appDelegate = [[[AppDelegate alloc]

0 commit comments

Comments
 (0)