Release acquired typed data before calling Dart_SetReturnValue. (flutter/engine#17729)

This commit is contained in:
Vyacheslav Egorov
2020-04-15 19:35:04 +02:00
committed by GitHub
parent 05aebc8032
commit 2eb118495b

View File

@@ -69,7 +69,9 @@ template <Dart_TypedData_Type kTypeName, typename ElemType>
void DartConverter<TypedList<kTypeName, ElemType>>::SetReturnValue(
Dart_NativeArguments args,
TypedList<kTypeName, ElemType> 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 <Dart_TypedData_Type kTypeName, typename ElemType>