summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/web-view-schemes/normal.c7
-rw-r--r--src/web-view-schemes/schemes.h1
-rw-r--r--src/web-view-schemes/view-source.c7
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,