summaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2014-10-19 17:33:16 +0000
committercorvid <devnull@localhost>2014-10-19 17:33:16 +0000
commitf089e0d592b5514443ea743e9fb7fdd535aa1ff2 (patch)
tree3944fda3e43ea29061b5f427435746bc975d87a5 /src/html.cc
parentdec55d87ea61564a0e05aabc74f05b7e5ce26d51 (diff)
free web when Domain denies open_url
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/html.cc b/src/html.cc
index 89f9ec70..843b69ff 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -2188,6 +2188,8 @@ DilloImage *a_Html_image_new(DilloHtml *html, const char *tag, int tagsize)
dw::Image *dw = new dw::Image(alt_ptr);
image =
a_Image_new(html->dw->getLayout(), (void*)(dw::core::ImgRenderer*)dw, 0);
+
+ a_Image_ref(image);
if (HT2TB(html)->getBgColor())
image->bg_color = HT2TB(html)->getBgColor()->getColor();
@@ -2204,10 +2206,10 @@ DilloImage *a_Html_image_new(DilloHtml *html, const char *tag, int tagsize)
if (load_now && Html_load_image(html->bw, url, html->page_url, image)) {
// hi->image is NULL if dillo tries to load the image immediately
hi->image = NULL;
+ a_Image_unref(image);
} else {
// otherwise a reference is kept in html->images
hi->image = image;
- a_Image_ref(image);
}
dFree(alt_ptr);