From aa74d71e0ee1db73a444f732aec23e2a43b8cbac Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Tue, 28 Nov 2017 14:19:08 -0500 Subject: [PATCH] Mac crash on error box after core is loaded --- platform_mac/mac_4ed.m | 5 +++-- platform_mac/osx_objective_c_to_cpp_links.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform_mac/mac_4ed.m b/platform_mac/mac_4ed.m index 19f76c0b..af4646d1 100644 --- a/platform_mac/mac_4ed.m +++ b/platform_mac/mac_4ed.m @@ -225,7 +225,7 @@ static i32 did_update_for_clipboard = true; - (void)init_gl { - if(osx_objc.running){ + if (osx_objc.gl_is_initialized){ return; } @@ -253,7 +253,7 @@ static i32 did_update_for_clipboard = true; [context makeCurrentContext]; - osx_objc.running = true; + osx_objc.gl_is_initialized = true; } - (id)init @@ -873,6 +873,7 @@ main(int argc, char **argv){ userInfo: nil repeats:YES]; osx_init(); + osx_objc.running = true; [NSApp run]; } diff --git a/platform_mac/osx_objective_c_to_cpp_links.h b/platform_mac/osx_objective_c_to_cpp_links.h index 8fbb10dd..11c98287 100644 --- a/platform_mac/osx_objective_c_to_cpp_links.h +++ b/platform_mac/osx_objective_c_to_cpp_links.h @@ -36,6 +36,7 @@ typedef struct OSX_Keyboard_Modifiers{ typedef struct OSX_Objective_C_Vars{ i32 width, height; + b32 gl_is_initialized; b32 running; u32 key_count; u32 keys[8];