(Apple) Build fix for platforms where we have ARC

enabled - can't use NSAutoreleasePool directly it seems
This commit is contained in:
twinaphex 2013-11-09 01:37:34 +01:00
parent 03495fdc3a
commit 223448d943
2 changed files with 16 additions and 0 deletions

View File

@ -242,6 +242,19 @@ static bool g_is_syncing = true;
static RAScreen* get_chosen_screen()
{
#if __has_feature(objc_arc)
@autoreleasepool {
if (g_settings.video.monitor_index >= RAScreen.screens.count)
{
RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n");
return RAScreen.mainScreen;
}
NSArray *screens = [RAScreen screens];
RAScreen *s = (RAScreen*)[screens objectAtIndex:g_settings.video.monitor_index];
return s;
}
#else
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (g_settings.video.monitor_index >= RAScreen.screens.count)
@ -255,6 +268,7 @@ static RAScreen* get_chosen_screen()
RAScreen *s = (RAScreen*)[screens objectAtIndex:g_settings.video.monitor_index];
[pool drain];
return s;
#endif
}
bool apple_gfx_ctx_init()

View File

@ -1199,6 +1199,7 @@ static void gl_init_textures(void *data, const video_info_t *video)
static inline void gl_copy_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch)
{
unsigned h;
(void)h;
gl_t *gl = (gl_t*)data;
#if defined(HAVE_OPENGLES2)
#if defined(HAVE_EGL)
@ -2335,6 +2336,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
{
unsigned i;
gl_t *gl = (gl_t*)data;
(void)i;
RARCH_PERFORMANCE_INIT(read_viewport);
RARCH_PERFORMANCE_START(read_viewport);