From fe528d7847b14438dcdb44f6048891b57031d022 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 14 May 2013 10:13:21 -0400 Subject: Minor e_web_view_install_request_handler() cleanup. Make reference count handling a bit less awkward. --- e-util/e-web-view.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'e-util') diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c index 1c0d88c66d..3153740eaf 100644 --- a/e-util/e-web-view.c +++ b/e-util/e-web-view.c @@ -2846,22 +2846,19 @@ e_web_view_install_request_handler (EWebView *web_view, { SoupSession *session; SoupSessionFeature *feature; - gboolean new; session = webkit_get_default_session (); feature = soup_session_get_feature (session, SOUP_TYPE_REQUESTER); - new = FALSE; - if (feature == NULL) { + if (feature != NULL) { + g_object_ref (feature); + } else { feature = SOUP_SESSION_FEATURE (soup_requester_new ()); soup_session_add_feature (session, feature); - new = TRUE; } soup_session_feature_add_feature (feature, handler_type); - if (new) { - g_object_unref (feature); - } + g_object_unref (feature); } -- cgit v1.2.3