[dawn][native] Reverts a change that's causing memory leak on fuzzer.
- In https://dawn-review.googlesource.com/c/dawn/+/251875 I added
an additional reference to the queue that is held by the serial
tasks, but it turns out that it's actually not needed and
problematic because it can cause a reference cycle leading to
leakage. Reverts the change and updates the comment.
Bug: 440369555, 440158604
Change-Id: I2fb39cd219ee491150228c9ec34e98a8e5c1082c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/258497
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Loko Kung <lokokung@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/src/dawn/native/EventManager.cpp b/src/dawn/native/EventManager.cpp
index f14c3ef..f605f5f 100644
--- a/src/dawn/native/EventManager.cpp
+++ b/src/dawn/native/EventManager.cpp
@@ -327,9 +327,9 @@
if (const auto* queueAndSerial = event->GetIfQueueAndSerial()) {
if (auto q = queueAndSerial->queue.Promote()) {
- q->TrackSerialTask(queueAndSerial->completionSerial, [this, q, event]() {
+ q->TrackSerialTask(queueAndSerial->completionSerial, [this, event]() {
// If this is executed, we can be sure that the raw pointer to this EventManager is
- // valid because the Queue is kept alive by the lambda capture and:
+ // valid because the task is ran by the Queue and:
// Queue -[refs]->
// Device -[refs]->
// Adapter -[refs]->