[vte] spawn: async: Check for nullptr before unreffing



commit f7e3c8ad342c4965d433bf3b05f418b9e984aa1f
Author: Christian Persch <chpe src gnome org>
Date:   Tue Mar 28 22:58:26 2017 +0200

    spawn: async: Check for nullptr before unreffing
    
    This needs to handle a null terminal. Improves the fix from
    commit 8ad57f190f33c41b1bc9051e919844a294feada9.

 src/vtegtk.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index f502d94..0247950 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -2362,7 +2362,8 @@ spawn_async_cb (GObject *source,
 
         spawn_async_callback_data_free(data);
 
-        g_object_unref(terminal);
+        if (terminal != nullptr)
+                g_object_unref(terminal);
 }
 
 


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