src/video/SDL_clipboard.c
changeset 6036 f2a89f2a6157
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
     1.1 --- a/src/video/SDL_clipboard.c	Sat Oct 29 23:34:19 2011 -0700
     1.2 +++ b/src/video/SDL_clipboard.c	Sat Oct 29 23:43:59 2011 -0700
     1.3 @@ -35,6 +35,9 @@
     1.4      if (_this->SetClipboardText) {
     1.5          return _this->SetClipboardText(_this, text);
     1.6      } else {
     1.7 +        if (_this->clipboard_text) {
     1.8 +            SDL_free(_this->clipboard_text);
     1.9 +        }
    1.10          _this->clipboard_text = SDL_strdup(text);
    1.11          return 0;
    1.12      }
    1.13 @@ -64,7 +67,7 @@
    1.14      if (_this->HasClipboardText) {
    1.15          return _this->HasClipboardText(_this);
    1.16      } else {
    1.17 -        if (_this->clipboard_text) {
    1.18 +        if ((_this->clipboard_text) && (SDL_strlen(_this->clipboard_text)>0)) {
    1.19              return SDL_TRUE;
    1.20          } else {
    1.21              return SDL_FALSE;