Skip to content

Commit

Permalink
fix: [android] Bound the IrisMethodChannel lifecycle with the Flutter…
Browse files Browse the repository at this point in the history
…Engine
  • Loading branch information
littleGnAl committed Aug 9, 2023
1 parent 073ea00 commit ebd8a62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/iris_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:isolate';
import 'package:async/async.dart';
import 'package:ffi/ffi.dart';
import 'package:flutter/foundation.dart'
show SynchronousFuture, VoidCallback, visibleForTesting;
show SynchronousFuture, VoidCallback, debugPrint, visibleForTesting;
import 'package:flutter/services.dart';
import 'package:iris_method_channel/src/bindings/native_iris_api_common_bindings.dart'
as iris;
Expand Down Expand Up @@ -406,6 +406,7 @@ class IrisMethodChannel {
void _setuponDetachedFromEngineListener() {
_channel.setMethodCallHandler((call) async {
if (call.method == 'onDetachedFromEngine_fromPlatform') {
debugPrint('Receive the onDetachedFromEngine callback, clean the native resources.');
dispose();
return true;
}
Expand Down

0 comments on commit ebd8a62

Please sign in to comment.