[evolution/webkit: 107/113] Fix memory leaks in EWebView



commit c572710bd350c61cc9616dd7d7785da0a0fcee26
Author: Dan VrÃtil <dvratil redhat com>
Date:   Mon Jan 9 10:39:07 2012 +0100

    Fix memory leaks in EWebView

 widgets/misc/e-web-view.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c
index 617b06e..44497a6 100644
--- a/widgets/misc/e-web-view.c
+++ b/widgets/misc/e-web-view.c
@@ -125,6 +125,7 @@ static const gchar *ui =
 "    <placeholder name='custom-actions-3'/>"
 "    <separator/>"
 "    <menuitem action='select-all'/>"
+"    <placeholder name='inspect-menu' />"
 "  </popup>"
 "</ui>";
 
@@ -723,6 +724,16 @@ web_view_button_press_event (GtkWidget *widget,
                 WebKitHitTestResult *test;
                 WebKitHitTestResultContext context;
 
+                if (web_view->priv->cursor_image) {
+                        g_object_unref (web_view->priv->cursor_image);
+                        web_view->priv->cursor_image = NULL;
+                }
+
+                if (web_view->priv->cursor_image_src) {
+                        g_free (web_view->priv->cursor_image_src);
+                        web_view->priv->cursor_image_src = NULL;
+                }
+
                 test = webkit_web_view_get_hit_test_result (WEBKIT_WEB_VIEW (web_view), event);
 
                 if (!test)
@@ -758,6 +769,8 @@ web_view_button_press_event (GtkWidget *widget,
                                         continue;
 
                                 data = webkit_web_resource_get_data (src);
+                                if (!data)
+                                        break;
 
                                 loader = gdk_pixbuf_loader_new ();
                                 if (!gdk_pixbuf_loader_write (loader,



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