Reset onFlush render tasks when allocation failed

Change-Id: I527be48790585b91a7b2b223a61de4b5ac30e3c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384096
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 3bc1b7d..9077e2c 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -347,6 +347,10 @@
     }
     fDAG.reset();
     fLastRenderTasks.reset();
+    for (const sk_sp<GrRenderTask>& onFlushRenderTask : fOnFlushRenderTasks) {
+        onFlushRenderTask->disown(this);
+    }
+    fOnFlushRenderTasks.reset();
 }
 
 void GrDrawingManager::sortTasks() {