From c7aef4e0b8290c83c4b086bc87d76e86d48dae14 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 30 Oct 2017 12:51:31 -0400 Subject: mq_web_view_*_scheme_methods->finalize(): New methods --- (limited to 'src/web-view-schemes') diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index 034a363..4da54cc 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -32,6 +32,12 @@ #include "../tab-page.h" #include "../web-view.h" +static void +finalize(MqWebViewScheme *scheme) +{ + memset(&scheme->normal, 0, sizeof(scheme->normal)); +} + static gchar * rewrite_uri(MqWebView G_GNUC_UNUSED *web_view, MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) @@ -764,6 +770,7 @@ save_file(MqWebView *web_view, MqWebViewScheme *scheme) } const MqWebViewSchemeMethods mq_web_view_normal_scheme_methods = { + .finalize = finalize, .rewrite_uri = rewrite_uri, .display_uri = display_uri, .context_menu = context_menu, diff --git a/src/web-view-schemes/schemes.h b/src/web-view-schemes/schemes.h index cf7d025..b3a5e74 100644 --- a/src/web-view-schemes/schemes.h +++ b/src/web-view-schemes/schemes.h @@ -49,6 +49,7 @@ union _MqWebViewScheme { }; typedef struct { + void (*finalize) (MqWebViewScheme *); gchar * (*rewrite_uri) (MqWebView *, MqWebViewScheme *, const gchar *); gchar * (*display_uri) (MqWebView *, MqWebViewScheme *, const gchar *); gboolean (*context_menu)(MqWebView *, MqWebViewScheme *, diff --git a/src/web-view-schemes/view-source.c b/src/web-view-schemes/view-source.c index 667fc24..b9fb5a2 100644 --- a/src/web-view-schemes/view-source.c +++ b/src/web-view-schemes/view-source.c @@ -33,6 +33,12 @@ #include "../tab-page.h" #include "../web-view.h" +static void +finalize(MqWebViewScheme *scheme) +{ + memset(&scheme->view_source, 0, sizeof(scheme->view_source)); +} + static gchar * rewrite_uri(MqWebView *web_view, MqWebViewScheme *scheme, const gchar *uri) { @@ -208,6 +214,7 @@ save_file(MqWebView *web_view, MqWebViewScheme *scheme) } const MqWebViewSchemeMethods mq_web_view_view_source_scheme_methods = { + .finalize = finalize, .rewrite_uri = rewrite_uri, .display_uri = display_uri, .context_menu = context_menu, -- cgit v0.9.1