Commit e290f926 authored by Tomas Popela's avatar Tomas Popela

Fix regressions after "Fix various leaks of WebKit DOM objects"

parent a7633261
...@@ -111,7 +111,6 @@ static WebKitDOMRange * ...@@ -111,7 +111,6 @@ static WebKitDOMRange *
html_editor_selection_get_current_range (EHTMLEditorSelection *selection) html_editor_selection_get_current_range (EHTMLEditorSelection *selection)
{ {
EHTMLEditorView *view; EHTMLEditorView *view;
WebKitWebView *web_view;
WebKitDOMDocument *document; WebKitDOMDocument *document;
WebKitDOMDOMWindow *dom_window; WebKitDOMDOMWindow *dom_window;
WebKitDOMDOMSelection *dom_selection; WebKitDOMDOMSelection *dom_selection;
...@@ -120,26 +119,26 @@ html_editor_selection_get_current_range (EHTMLEditorSelection *selection) ...@@ -120,26 +119,26 @@ html_editor_selection_get_current_range (EHTMLEditorSelection *selection)
view = e_html_editor_selection_ref_html_editor_view (selection); view = e_html_editor_selection_ref_html_editor_view (selection);
g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (view != NULL, NULL);
web_view = WEBKIT_WEB_VIEW (view); document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
document = webkit_web_view_get_dom_document (web_view);
dom_window = webkit_dom_document_get_default_view (document); dom_window = webkit_dom_document_get_default_view (document);
if (!dom_window) if (!dom_window)
goto exit; return NULL;
dom_selection = webkit_dom_dom_window_get_selection (dom_window); dom_selection = webkit_dom_dom_window_get_selection (dom_window);
if (!WEBKIT_DOM_IS_DOM_SELECTION (dom_selection)) if (!dom_selection) {
goto exit; g_object_unref (dom_window);
return NULL;
}
if (webkit_dom_dom_selection_get_range_count (dom_selection) < 1) if (webkit_dom_dom_selection_get_range_count (dom_selection) < 1) {
goto exit; goto exit;
}
range = webkit_dom_dom_selection_get_range_at (dom_selection, 0, NULL); range = webkit_dom_dom_selection_get_range_at (dom_selection, 0, NULL);
exit: exit:
g_object_unref (dom_selection); g_object_unref (dom_selection);
g_object_unref (dom_window); g_object_unref (dom_window);
g_object_unref (view);
return range; return range;
} }
......
...@@ -489,7 +489,7 @@ perform_spell_check (WebKitDOMDOMSelection *dom_selection, ...@@ -489,7 +489,7 @@ perform_spell_check (WebKitDOMDOMSelection *dom_selection,
actual = webkit_dom_dom_selection_get_range_at ( actual = webkit_dom_dom_selection_get_range_at (
dom_selection, 0, NULL); dom_selection, 0, NULL);
} }
g_object_unref (actual); g_clear_object (&actual);
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment