[epiphany/gnome-3-34] view-source-handler: complete request at most once



commit 58499c035ecf3782bc3529ccade53e823eff976b
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Jan 22 21:17:04 2020 +0000

    view-source-handler: complete request at most once
    
    If we fail to disconnect the signal after the page loads, it could start
    another load on its own using JS, which would be a disaster because we
    already freed the EphyViewSourceRequest after the first load.
    
    Hopefully fixes #1065
    
    
    (cherry picked from commit 65a97fecee6a8db32316fe1bb3aa7faea4e5892a)

 embed/ephy-view-source-handler.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/embed/ephy-view-source-handler.c b/embed/ephy-view-source-handler.c
index d10867a07..a5b28e04f 100644
--- a/embed/ephy-view-source-handler.c
+++ b/embed/ephy-view-source-handler.c
@@ -158,8 +158,12 @@ load_changed_cb (WebKitWebView         *web_view,
                  WebKitLoadEvent        load_event,
                  EphyViewSourceRequest *request)
 {
-  if (load_event == WEBKIT_LOAD_FINISHED)
+  if (load_event == WEBKIT_LOAD_FINISHED) {
+    g_signal_handler_disconnect (request->web_view, request->load_changed_id);
+    request->load_changed_id = 0;
+
     ephy_view_source_request_begin_get_source_from_web_view (request, web_view);
+  }
 }
 
 static void


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