diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-10-06 19:26:15 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-10-06 19:26:15 +0000 |
commit | 041ad8f5ae9d25242a6d39ea8bfc860bc55b0167 (patch) | |
tree | 83b9e28bff39870c75935d918009e38acb6c5329 /src/stylesheet.c | |
parent | e5913135a86509fac8d16e7c4993fd10357a663e (diff) | |
download | libcss-041ad8f5ae9d25242a6d39ea8bfc860bc55b0167.tar.gz libcss-041ad8f5ae9d25242a6d39ea8bfc860bc55b0167.tar.bz2 |
Extend lifetime of property strings
svn path=/trunk/libcss/; revision=12974
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r-- | src/stylesheet.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c index ba76d37..f8dedac 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -140,6 +140,12 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, return CSS_NOMEM; memset(sheet, 0, sizeof(css_stylesheet)); + + error = css__propstrings_get(&sheet->propstrings); + if (error != CSS_OK) { + alloc(sheet, 0, alloc_pw); + return error; + } sheet->inline_style = params->inline_style; @@ -156,6 +162,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, } if (error != CSS_OK) { + css__propstrings_unref(); alloc(sheet, 0, alloc_pw); return error; } @@ -169,6 +176,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, &optparams); if (error != CSS_OK) { css__parser_destroy(sheet->parser); + css__propstrings_unref(); alloc(sheet, 0, alloc_pw); return error; } @@ -179,6 +187,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, &sheet->parser_frontend); if (error != CSS_OK) { css__parser_destroy(sheet->parser); + css__propstrings_unref(); alloc(sheet, 0, alloc_pw); return error; } @@ -188,6 +197,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, if (error != CSS_OK) { css__language_destroy(sheet->parser_frontend); css__parser_destroy(sheet->parser); + css__propstrings_unref(); alloc(sheet, 0, alloc_pw); return error; } @@ -198,6 +208,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, css__selector_hash_destroy(sheet->selectors); css__language_destroy(sheet->parser_frontend); css__parser_destroy(sheet->parser); + css__propstrings_unref(); alloc(sheet, 0, alloc_pw); return CSS_NOMEM; } @@ -211,6 +222,7 @@ css_error css_stylesheet_create(const css_stylesheet_params *params, css__selector_hash_destroy(sheet->selectors); css__language_destroy(sheet->parser_frontend); css__parser_destroy(sheet->parser); + css__propstrings_unref(); alloc(sheet, 0, alloc_pw); return CSS_NOMEM; } @@ -293,6 +305,8 @@ css_error css_stylesheet_destroy(css_stylesheet *sheet) if (sheet->string_vector != NULL) sheet->alloc(sheet->string_vector, 0, sheet->pw); + css__propstrings_unref(); + sheet->alloc(sheet, 0, sheet->pw); return CSS_OK; |