瀏覽代碼

SDL_SetHintWithPriority: better test if hint value has changed.

Ryan C. Gordon 3 年之前
父節點
當前提交
c391bdc160
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/SDL_hints.c

+ 1 - 1
src/SDL_hints.c

@@ -66,7 +66,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
             if (priority < hint->priority) {
                 return SDL_FALSE;
             }
-            if (!hint->value || !value || SDL_strcmp(hint->value, value) != 0) {
+            if ( ((hint->value == NULL) != (value == NULL)) || (value && (SDL_strcmp(hint->value, value) != 0)) ) {
                 for (entry = hint->callbacks; entry; ) {
                     /* Save the next entry in case this one is deleted */
                     SDL_HintWatch *next = entry->next;