mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-13 22:01:53 +00:00
LibWeb: Remove some uses of [&] lambda captures for queued tasks
Using a default reference capture for these kinds of tasks is dangerous and prone to error. Some of the variables should for sure be captured by value so that we can keep a GC object alive rather than trying to refer to stack objects.
This commit is contained in:
parent
6ed2bf2bb1
commit
66519af43f
Notes:
github-actions[bot]
2024-12-10 06:14:03 +00:00
Author: https://github.com/ADKaster
Commit: 66519af43f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2860
4 changed files with 10 additions and 10 deletions
|
@ -352,8 +352,8 @@ WebIDL::ExceptionOr<GC::Ref<WebIDL::Promise>> HTMLImageElement::decode() const
|
|||
|
||||
// 3. Otherwise, in parallel wait for one of the following cases to occur, and perform the corresponding actions:
|
||||
Platform::EventLoopPlugin::the().deferred_invoke(GC::create_function(heap(), [this, promise, &realm, &global] {
|
||||
Platform::EventLoopPlugin::the().spin_until(GC::create_function(heap(), [&] {
|
||||
auto queue_reject_task = [&](String const& message) {
|
||||
Platform::EventLoopPlugin::the().spin_until(GC::create_function(heap(), [this, promise, &realm, &global] {
|
||||
auto queue_reject_task = [promise, &realm, &global](String const& message) {
|
||||
queue_global_task(Task::Source::DOMManipulation, global, GC::create_function(realm.heap(), [&realm, promise, message = String(message)] {
|
||||
auto exception = WebIDL::EncodingError::create(realm, message);
|
||||
HTML::TemporaryExecutionContext context(realm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue