Merge lp:~gue5t/midori/resource-ref into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6742
Merged at revision: 6767
Proposed branch: lp:~gue5t/midori/resource-ref
Merge into: lp:midori
Diff against target: 49 lines (+13/-1)
2 files modified
midori/midori-browser.c (+1/-0)
midori/midori-view.c (+12/-1)
To merge this branch: bzr merge lp:~gue5t/midori/resource-ref
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+228922@code.launchpad.net

Commit message

Fix crash when saving with associated resources

Description of the change

This fixes a crash caused by not reffing resources which we obtain from WebKit when saving them.

To post a comment you must log in.
lp:~gue5t/midori/resource-ref updated
6742. By gue5t <email address hidden>

Merge upstream

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Looks sensible and fixed the crash.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'midori/midori-browser.c'
--- midori/midori-browser.c 2014-07-27 16:50:30 +0000
+++ midori/midori-browser.c 2014-07-30 17:48:41 +0000
@@ -1372,6 +1372,7 @@
1372 katze_assign (last_dir,1372 katze_assign (last_dir,
1373 gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)));1373 gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)));
1374 }1374 }
1375 g_list_foreach (resources, (GFunc)g_object_unref, NULL);
1375 g_list_free (resources);1376 g_list_free (resources);
1376#else1377#else
1377 filename = midori_download_clean_filename (title);1378 filename = midori_download_clean_filename (title);
13781379
=== modified file 'midori/midori-view.c'
--- midori/midori-view.c 2014-07-27 16:50:30 +0000
+++ midori/midori-view.c 2014-07-30 17:48:41 +0000
@@ -2037,6 +2037,14 @@
2037 g_free (uri);2037 g_free (uri);
2038}2038}
20392039
2040/**
2041 * midori_view_get_resources:
2042 * @view: a #MidoriView
2043 *
2044 * Obtain a list of the resources loaded by the page shown in the view.
2045 *
2046 * Return value: (transfer full) (element-type WebKitWebResource): the resources
2047 **/
2040GList*2048GList*
2041midori_view_get_resources (MidoriView* view)2049midori_view_get_resources (MidoriView* view)
2042{2050{
@@ -2047,7 +2055,9 @@
2047 WebKitWebFrame* frame = webkit_web_view_get_main_frame (web_view);2055 WebKitWebFrame* frame = webkit_web_view_get_main_frame (web_view);
2048 WebKitWebDataSource* data_source = webkit_web_frame_get_data_source (frame);2056 WebKitWebDataSource* data_source = webkit_web_frame_get_data_source (frame);
2049 GList* resources = webkit_web_data_source_get_subresources (data_source);2057 GList* resources = webkit_web_data_source_get_subresources (data_source);
2050 return g_list_prepend (resources, webkit_web_data_source_get_main_resource (data_source));2058 resources = g_list_prepend (resources, webkit_web_data_source_get_main_resource (data_source));
2059 g_list_foreach (resources, (GFunc)g_object_ref, NULL);
2060 return resources;
2051#else2061#else
2052 return NULL;2062 return NULL;
2053#endif2063#endif
@@ -2073,6 +2083,7 @@
2073 }2083 }
2074 }2084 }
2075#endif2085#endif
2086 g_list_foreach (resources, (GFunc)g_object_unref, NULL);
2076 g_list_free (resources);2087 g_list_free (resources);
2077 return result;2088 return result;
2078}2089}

Subscribers

People subscribed via source and target branches

to all changes: