The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
(iOS)UIKit_GetSupportedOrientations maybe receive invalid wi
ancientli


Joined: 01 Jul 2015
Posts: 45
Used SDL: SDL 2.0.4(2015.7.7)
Used iOS: iOS 8.4.0

When user rotate device, code is into SDL_uikitviewcontroller::supportedInterfaceOrientations. supportedInterfaceOrientations will call UIKit_GetSupportedOrientations, and sends window to its' parameter.

But I found, window maybe invalid random. Once invalid, below statement in UIKit_GetSupportedOrientations will result to application crash.

SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;

How to solve it?