[vte] widget: Fix idle child-exited signal after dispose



commit 69f941dbe2a6df6513ec7f0cce6fbded20257beb
Author: Christian Persch <chpe src gnome org>
Date:   Wed Dec 23 18:53:33 2020 +0100

    widget: Fix idle child-exited signal after dispose
    
    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/322

 src/vte.cc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 4674241d..d813e16c 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -898,12 +898,17 @@ Terminal::emit_eof()
 
 static gboolean
 emit_eof_idle_cb(VteTerminal *terminal)
+try
 {
         _vte_terminal_get_impl(terminal)->emit_eof();
-        // @terminal might be destroyed at this point
 
         return G_SOURCE_REMOVE;
 }
+catch (...)
+{
+        vte::log_exception();
+        return G_SOURCE_REMOVE;
+}
 
 void
 Terminal::queue_eof()
@@ -928,12 +933,17 @@ Terminal::emit_child_exited()
 
 static gboolean
 emit_child_exited_idle_cb(VteTerminal *terminal)
+try
 {
         _vte_terminal_get_impl(terminal)->emit_child_exited();
-        // @terminal might be destroyed at this point
 
         return G_SOURCE_REMOVE;
 }
+catch (...)
+{
+        vte::log_exception();
+        return G_SOURCE_REMOVE;
+}
 
 /* Emit a "child-exited" signal on idle, so that if the handler destroys
  * the terminal, we're not deep within terminal code callstack


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