mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Make HTML::SharedImageRequest GC allocated
This allows to partially solve the problem of cyclic dependency between HTMLImageElement and SharedImageRequest that prevents all image elements from being deallocated.
This commit is contained in:
parent
bbfedf2e5a
commit
934afcb9d5
9 changed files with 46 additions and 18 deletions
|
@ -31,7 +31,7 @@ void ImageStyleValue::load_any_resources(DOM::Document& document)
|
|||
return;
|
||||
m_document = &document;
|
||||
|
||||
m_image_request = HTML::SharedImageRequest::get_or_create(*document.page(), m_url).release_value_but_fixme_should_propagate_errors();
|
||||
m_image_request = HTML::SharedImageRequest::get_or_create(document.realm(), *document.page(), m_url);
|
||||
m_image_request->add_callbacks(
|
||||
[this, weak_this = make_weak_ptr()] {
|
||||
if (!weak_this)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue