[GLIB] WebDriver: dbusConnectionClosedCallback can be called after SessionHost has...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2018 10:53:17 +0000 (10:53 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2018 10:53:17 +0000 (10:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192976

Reviewed by Alejandro G. Castro.

Disconnect DBus connection signals using SessionHost as user data in SessionHost destructor.

* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::~SessionHost):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebDriver/ChangeLog
Source/WebDriver/glib/SessionHostGlib.cpp

index c7aa1e9..11c8270 100644 (file)
@@ -1,3 +1,15 @@
+2018-12-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] WebDriver: dbusConnectionClosedCallback can be called after SessionHost has been deleted
+        https://bugs.webkit.org/show_bug.cgi?id=192976
+
+        Reviewed by Alejandro G. Castro.
+
+        Disconnect DBus connection signals using SessionHost as user data in SessionHost destructor.
+
+        * glib/SessionHostGlib.cpp:
+        (WebDriver::SessionHost::~SessionHost):
+
 2018-12-20  Chris Dumez  <cdumez@apple.com>
 
         Use Optional::valueOr() instead of Optional::value_or()
index 0b2ddaa..364ca80 100644 (file)
@@ -41,6 +41,8 @@ namespace WebDriver {
 
 SessionHost::~SessionHost()
 {
+    if (m_dbusConnection)
+        g_signal_handlers_disconnect_matched(m_dbusConnection.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
     g_cancellable_cancel(m_cancellable.get());
     if (m_browser)
         g_subprocess_force_exit(m_browser.get());