Skip to content

Commit

Permalink
Release plugin binding when activity is detached. (#1264)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom authored Jan 16, 2024
1 parent 978dbeb commit bb8e40a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions permission_handler_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 12.0.2

* Fixes bug where Android activity is leaked when embedded in native Android application.

## 12.0.1

* Fixes a bug where the `ignoreBatteryOptimizations` permission didn't report the correct status when the permission is requested and granted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
binding.getActivity()
);

this.pluginBinding = binding;
pluginBinding = binding;
registerListeners();
}

Expand All @@ -87,8 +87,8 @@ public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBindin
@Override
public void onDetachedFromActivity() {
stopListeningToActivity();

deregisterListeners();
pluginBinding = null;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion permission_handler_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: permission_handler_android
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
homepage: https://github.com/baseflow/flutter-permission-handler
version: 12.0.1
version: 12.0.2

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down

0 comments on commit bb8e40a

Please sign in to comment.