Skip to content

Commit 7344a66

Browse files
committed
app_init
1 parent 0763ac3 commit 7344a66

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Runtime/Unity.NodeApi.Native.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ extern "C" void UnityFiberProc()
6262
imagePath = imagePath.substr(0, imagePath.find_last_of(IL2CPP_DIR_SEPARATOR));
6363
imagePath = imagePath.substr(0, imagePath.find_last_of(IL2CPP_DIR_SEPARATOR));
6464
imagePath = imagePath.substr(0, imagePath.find_last_of(IL2CPP_DIR_SEPARATOR));
65-
extern void NSBundle_fixup(const char *path);
66-
NSBundle_fixup(imagePath.c_str());
65+
extern void app_init(const char *path);
66+
app_init(imagePath.c_str());
6767

6868
const char *argv[] = { os::Image::GetImageName(), "-logfile", "-" };
6969
playerProc(1, argv);

Runtime/Unity.NodeApi.Native.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <objc/runtime.h>
66

77
static NSBundle *mainBundleFix;
8+
static auto appKit = [[NSBundle bundleWithPath:@"/System/Library/Frameworks/AppKit.framework"] load];
89

910
@implementation NSBundle(BundleFixup)
1011

@@ -22,7 +23,7 @@ +(NSBundle *)mainBundleFix
2223

2324
@end
2425

25-
extern "C" void NSBundle_fixup(const char *path)
26+
extern "C" void app_init(const char *path)
2627
{
2728
@autoreleasepool
2829
{
@@ -45,7 +46,6 @@ +(NSBundle *)mainBundleFix
4546
{
4647
@autoreleasepool
4748
{
48-
[[NSBundle bundleWithPath:@"/System/Library/Frameworks/AppKit.framework"] load];
4949
CADisplayLink *link = [[NSClassFromString(@"NSScreen") mainScreen] displayLinkWithTarget:[^{cb(data);} copy] selector:@selector(invoke)];
5050
[link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
5151
}

0 commit comments

Comments
 (0)