summaryrefslogtreecommitdiff
path: root/render/textplain.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/textplain.c')
-rw-r--r--render/textplain.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/render/textplain.c b/render/textplain.c
index 1b1876786..786fe21e0 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -148,7 +148,6 @@ static const content_handler textplain_content_handler = {
.no_share = true,
};
-static lwc_string *textplain_mime_type;
static lwc_string *textplain_charset;
static lwc_string *textplain_default_charset;
@@ -160,15 +159,9 @@ nserror textplain_init(void)
lwc_error lerror;
nserror error;
- lerror = lwc_intern_string("text/plain", SLEN("text/plain"),
- &textplain_mime_type);
- if (lerror != lwc_error_ok)
- return NSERROR_NOMEM;
-
lerror = lwc_intern_string("charset", SLEN("charset"),
&textplain_charset);
if (lerror != lwc_error_ok) {
- lwc_string_unref(textplain_mime_type);
return NSERROR_NOMEM;
}
@@ -176,16 +169,14 @@ nserror textplain_init(void)
&textplain_default_charset);
if (lerror != lwc_error_ok) {
lwc_string_unref(textplain_charset);
- lwc_string_unref(textplain_mime_type);
return NSERROR_NOMEM;
}
- error = content_factory_register_handler(textplain_mime_type,
+ error = content_factory_register_handler("text/plain",
&textplain_content_handler);
if (error != NSERROR_OK) {
lwc_string_unref(textplain_default_charset);
lwc_string_unref(textplain_charset);
- lwc_string_unref(textplain_mime_type);
}
return error;
@@ -196,9 +187,15 @@ nserror textplain_init(void)
*/
void textplain_fini(void)
{
- lwc_string_unref(textplain_default_charset);
- lwc_string_unref(textplain_charset);
- lwc_string_unref(textplain_mime_type);
+ if (textplain_default_charset != NULL) {
+ lwc_string_unref(textplain_default_charset);
+ textplain_default_charset = NULL;
+ }
+
+ if (textplain_charset != NULL) {
+ lwc_string_unref(textplain_charset);
+ textplain_charset = NULL;
+ }
}
/**