[gnome-shell] WindowTracker: fix ref counting bug in get_app_for_window()



commit a1bb0ec7389332a8a070c2edd18409a0773245c3
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Jun 27 19:14:27 2012 +0200

    WindowTracker: fix ref counting bug in get_app_for_window()
    
    get_app_for_window() is (transfer full), but shell_app_system_lookup_wmclass()
    is (transfer none), so we must reference the result, or crash
    occur.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678992

 src/shell-window-tracker.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c
index b97f542..d2cc7a8 100644
--- a/src/shell-window-tracker.c
+++ b/src/shell-window-tracker.c
@@ -299,7 +299,7 @@ get_app_for_window (ShellWindowTracker    *tracker,
   result = shell_app_system_lookup_wmclass (app_system,
                                             meta_window_get_wm_class (window));
   if (result != NULL)
-    return result;
+    return g_object_ref (result);
 
   result = get_app_from_window_pid (tracker, window);
   if (result != NULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]