Browse Source

tray: Don't call g_object_unref(NULL)

g_object_unref() only accepts valid object instances.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie 3 months ago
parent
commit
bba066c44c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/tray/unix/SDL_tray.c

+ 3 - 1
src/tray/unix/SDL_tray.c

@@ -671,7 +671,9 @@ void SDL_DestroyTray(SDL_Tray *tray)
         SDL_RemovePath(tray->icon_path);
     }
 
-    g_object_unref(tray->indicator);
+    if (tray->indicator) {
+        g_object_unref(tray->indicator);
+    }
 
     SDL_free(tray);