Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/9769e8f2c067b8f5bbebe3bede0ab223dbae357d
...commit
http://git.netsurf-browser.org/netsurf.git/commit/9769e8f2c067b8f5bbebe3bede0ab223dbae357d
...tree
http://git.netsurf-browser.org/netsurf.git/tree/9769e8f2c067b8f5bbebe3bede0ab223dbae357d
The branch, master has been updated
via 9769e8f2c067b8f5bbebe3bede0ab223dbae357d (commit)
from 36d83668c2070fb5085137178900dff7d3017e08 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=9769e8f2c067b8f5bbebe3bede0ab223dbae357d
commit 9769e8f2c067b8f5bbebe3bede0ab223dbae357d
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Clean up async/defer JS contents during parent finalisation
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/html/html_script.c
b/content/handlers/html/html_script.c
index b404d2e..6f62fb9 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -597,16 +597,21 @@ nserror html_script_free(html_content *html)
dom_string_unref(html->scripts[i].mimetype);
}
- if ((html->scripts[i].type == HTML_SCRIPT_INLINE) &&
- (html->scripts[i].data.string != NULL)) {
-
- dom_string_unref(html->scripts[i].data.string);
-
- } else if ((html->scripts[i].type == HTML_SCRIPT_SYNC) &&
- (html->scripts[i].data.handle != NULL)) {
-
- hlcache_handle_release(html->scripts[i].data.handle);
-
+ switch (html->scripts[i].type) {
+ case HTML_SCRIPT_INLINE:
+ if (html->scripts[i].data.string != NULL) {
+ dom_string_unref(html->scripts[i].data.string);
+ }
+ break;
+ case HTML_SCRIPT_SYNC:
+ /* fallthrough */
+ case HTML_SCRIPT_ASYNC:
+ /* fallthrough */
+ case HTML_SCRIPT_DEFER:
+ if (html->scripts[i].data.handle != NULL) {
+
hlcache_handle_release(html->scripts[i].data.handle);
+ }
+ break;
}
}
free(html->scripts);
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/html_script.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/content/handlers/html/html_script.c
b/content/handlers/html/html_script.c
index b404d2e..6f62fb9 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -597,16 +597,21 @@ nserror html_script_free(html_content *html)
dom_string_unref(html->scripts[i].mimetype);
}
- if ((html->scripts[i].type == HTML_SCRIPT_INLINE) &&
- (html->scripts[i].data.string != NULL)) {
-
- dom_string_unref(html->scripts[i].data.string);
-
- } else if ((html->scripts[i].type == HTML_SCRIPT_SYNC) &&
- (html->scripts[i].data.handle != NULL)) {
-
- hlcache_handle_release(html->scripts[i].data.handle);
-
+ switch (html->scripts[i].type) {
+ case HTML_SCRIPT_INLINE:
+ if (html->scripts[i].data.string != NULL) {
+ dom_string_unref(html->scripts[i].data.string);
+ }
+ break;
+ case HTML_SCRIPT_SYNC:
+ /* fallthrough */
+ case HTML_SCRIPT_ASYNC:
+ /* fallthrough */
+ case HTML_SCRIPT_DEFER:
+ if (html->scripts[i].data.handle != NULL) {
+
hlcache_handle_release(html->scripts[i].data.handle);
+ }
+ break;
}
}
free(html->scripts);
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org