diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-30 12:51:31 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-30 12:51:31 (EDT) |
commit | c7aef4e0b8290c83c4b086bc87d76e86d48dae14 (patch) | |
tree | 95450413ad8877d9298cb856dedf2bea88cfe802 /src/web-view-schemes | |
parent | c2740ed57eec6dc1b54c8a5fd02271f4ccb010c7 (diff) | |
download | marquee-c7aef4e0b8290c83c4b086bc87d76e86d48dae14.zip marquee-c7aef4e0b8290c83c4b086bc87d76e86d48dae14.tar.gz marquee-c7aef4e0b8290c83c4b086bc87d76e86d48dae14.tar.bz2 |
mq_web_view_*_scheme_methods->finalize(): New methods
Diffstat (limited to 'src/web-view-schemes')
-rw-r--r-- | src/web-view-schemes/normal.c | 7 | ||||
-rw-r--r-- | src/web-view-schemes/schemes.h | 1 | ||||
-rw-r--r-- | src/web-view-schemes/view-source.c | 7 |
3 files changed, 15 insertions, 0 deletions
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, |