diff src/video/SDL_video.c @ 3683:4c5ab6841fdc

From: Jjgod Jiang Date: Mon, 18 Jan 2010 17:46:35 +0800 Subject: [PATCH] Polish text input handling for Mac OS X - Prevent crash caused by uninitialized video data - Prevent beeping caused by unhandled Cocoa selectors (like moveUp: moveDown:, etc.)
author Sam Lantinga <slouken@libsdl.org>
date Tue, 19 Jan 2010 07:28:51 +0000
parents 8e961ef35d4b
children 64ce267332c6
line wrap: on
line diff
--- a/src/video/SDL_video.c	Tue Jan 19 05:31:16 2010 +0000
+++ b/src/video/SDL_video.c	Tue Jan 19 07:28:51 2010 +0000
@@ -3580,7 +3580,7 @@
 void
 SDL_StartTextInput(void)
 {
-    if (_this->StartTextInput) {
+    if (_this && _this->StartTextInput) {
         _this->StartTextInput(_this);
     }
     SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
@@ -3590,7 +3590,7 @@
 void
 SDL_StopTextInput(void)
 {
-    if (_this->StopTextInput) {
+    if (_this && _this->StopTextInput) {
         _this->StopTextInput(_this);
     }
     SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
@@ -3600,7 +3600,7 @@
 void
 SDL_SetTextInputRect(SDL_Rect *rect)
 {
-    if (_this->SetTextInputRect) {
+    if (_this && _this->SetTextInputRect) {
         _this->SetTextInputRect(_this, rect);
     }
 }