From 2eb118495b7ad66b03cac55132b0abae068bf122 Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Wed, 15 Apr 2020 19:35:04 +0200 Subject: [PATCH] Release acquired typed data before calling Dart_SetReturnValue. (flutter/engine#17729) --- engine/src/flutter/third_party/tonic/typed_data/typed_list.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/third_party/tonic/typed_data/typed_list.cc b/engine/src/flutter/third_party/tonic/typed_data/typed_list.cc index 3a491c005e..ffe662591d 100644 --- a/engine/src/flutter/third_party/tonic/typed_data/typed_list.cc +++ b/engine/src/flutter/third_party/tonic/typed_data/typed_list.cc @@ -69,7 +69,9 @@ template void DartConverter>::SetReturnValue( Dart_NativeArguments args, TypedList val) { - Dart_SetReturnValue(args, val.dart_handle()); + Dart_Handle result = val.dart_handle(); + val.Release(); // Must release acquired typed data before calling Dart API. + Dart_SetReturnValue(args, result); } template