src/video/uikit/SDL_uikitview.m
branchiOS-improvements
changeset 9506 18e3f94bd860
parent 9505 6fc615dfc93f
child 9510 e19faa3b5d88
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Jul 29 00:05:48 2014 -0300
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Jul 29 00:36:12 2014 -0300
     1.3 @@ -318,28 +318,34 @@
     1.4  
     1.5  void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window)
     1.6  {
     1.7 -    SDL_uikitview *view = getWindowView(window);
     1.8 -    if (view != nil) {
     1.9 -        [view showKeyboard];
    1.10 +    @autoreleasepool {
    1.11 +        SDL_uikitview *view = getWindowView(window);
    1.12 +        if (view != nil) {
    1.13 +            [view showKeyboard];
    1.14 +        }
    1.15      }
    1.16  }
    1.17  
    1.18  void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window)
    1.19  {
    1.20 -    SDL_uikitview *view = getWindowView(window);
    1.21 -    if (view != nil) {
    1.22 -        [view hideKeyboard];
    1.23 +    @autoreleasepool {
    1.24 +        SDL_uikitview *view = getWindowView(window);
    1.25 +        if (view != nil) {
    1.26 +            [view hideKeyboard];
    1.27 +        }
    1.28      }
    1.29  }
    1.30  
    1.31  SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window)
    1.32  {
    1.33 -    SDL_uikitview *view = getWindowView(window);
    1.34 -    if (view == nil) {
    1.35 -        return 0;
    1.36 +    @autoreleasepool {
    1.37 +        SDL_uikitview *view = getWindowView(window);
    1.38 +        if (view == nil) {
    1.39 +            return 0;
    1.40 +        }
    1.41 +
    1.42 +        return view.isKeyboardVisible;
    1.43      }
    1.44 -
    1.45 -    return view.isKeyboardVisible;
    1.46  }
    1.47  
    1.48  
    1.49 @@ -423,13 +429,15 @@
    1.50          SDL_InvalidParamError("rect");
    1.51          return;
    1.52      }
    1.53 -    
    1.54 -    SDL_uikitview *view = getWindowView(SDL_GetFocusWindow());
    1.55 -    if (view == nil) {
    1.56 -        return ;
    1.57 +
    1.58 +    @autoreleasepool {
    1.59 +        SDL_uikitview *view = getWindowView(SDL_GetFocusWindow());
    1.60 +        if (view == nil) {
    1.61 +            return;
    1.62 +        }
    1.63 +
    1.64 +        view.textInputRect = *rect;
    1.65      }
    1.66 -
    1.67 -    view.textInputRect = *rect;
    1.68  }
    1.69  
    1.70