Skip to content

Commit

Permalink
Use g_autoptr :wqfor simpler code
Browse files Browse the repository at this point in the history
  • Loading branch information
lauromoura committed Mar 10, 2024
1 parent 98da902 commit 1307567
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions launcher/cog-launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ on_automation_session_create_web_view(WebKitAutomationSession *session, CogLaunc
webkit_website_policies_new_with_policies("autoplay", s_options.autoplay_policy, NULL);
#endif /* HAVE_WEBKIT_AUTOPLAY */

WebKitWebView *new_view =
g_autoptr(WebKitWebView) new_view =
(WebKitWebView *) cog_view_new("settings", cog_shell_get_web_settings(launcher->shell), "web-context",
cog_shell_get_web_context(launcher->shell), "is-controlled-by-automation", TRUE,
"zoom-level", s_options.scale_factor, "use-key-bindings", FALSE,
Expand All @@ -253,8 +253,6 @@ on_automation_session_create_web_view(WebKitAutomationSession *session, CogLaunc
NULL);
// FIXME New window should be new viewport
cog_viewport_add(launcher->viewport, (CogView *) new_view);
// Let viewport own the view
g_object_unref(new_view);

return new_view;
}
Expand Down

0 comments on commit 1307567

Please sign in to comment.