[epiphany/mcatanzaro/web-extension-proxy: 1/3] web-extension-proxy: Code cleanups



commit 08f215a092d8b6baa27ac9e8b9b97d86829e91f6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Mar 1 21:57:18 2019 -0600

    web-extension-proxy: Code cleanups

 embed/ephy-web-extension-proxy.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/embed/ephy-web-extension-proxy.c b/embed/ephy-web-extension-proxy.c
index 2e60c0365..dac338df4 100644
--- a/embed/ephy-web-extension-proxy.c
+++ b/embed/ephy-web-extension-proxy.c
@@ -113,13 +113,12 @@ web_extension_proxy_created_cb (GDBusProxy            *proxy,
                                 GAsyncResult          *result,
                                 EphyWebExtensionProxy *web_extension)
 {
-  GError *error = NULL;
+  g_autoptr(GError) error = NULL;
 
   web_extension->proxy = g_dbus_proxy_new_finish (result, &error);
   if (!web_extension->proxy) {
     if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
       g_warning ("Error creating web extension proxy: %s", error->message);
-    g_error_free (error);
 
     /* Attempt to trigger connection_closed_cb, which will destroy us, and ensure that
      * that EphyEmbedShell will remove us from its extensions list.
@@ -152,10 +151,8 @@ connection_closed_cb (GDBusConnection       *connection,
                       GError                *error,
                       EphyWebExtensionProxy *web_extension)
 {
-  if (error) {
-    if (!remote_peer_vanished)
-      g_warning ("Unexpectedly lost connection to web extension: %s", error->message);
-  }
+  if (error && !remote_peer_vanished)
+    g_warning ("Unexpectedly lost connection to web extension: %s", error->message);
 
   g_object_unref (web_extension);
 }
@@ -335,4 +332,4 @@ ephy_web_extension_proxy_password_query_response (EphyWebExtensionProxy *web_ext
                      -1,
                      web_extension->cancellable,
                      NULL, NULL);
-}
\ No newline at end of file
+}


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