Skip to content

Commit

Permalink
Handle onDetachedFromEngine in Android (#1746)
Browse files Browse the repository at this point in the history
Do not leave behind a stale channel or application context. Undo
what onnAttachedToEngine does.
  • Loading branch information
emersion authored Oct 11, 2022
1 parent f38183d commit c9d3132
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,11 @@ public void onAttachedToEngine(FlutterPluginBinding binding) {
}

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {}
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
this.channel.setMethodCallHandler(null);
this.channel = null;
this.applicationContext = null;
}

@Override
public void onAttachedToActivity(ActivityPluginBinding binding) {
Expand Down

0 comments on commit c9d3132

Please sign in to comment.