Skip to content

Commit bb8e40a

Browse files
authored
Release plugin binding when activity is detached. (#1264)
1 parent 978dbeb commit bb8e40a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

permission_handler_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 12.0.2
2+
3+
* Fixes bug where Android activity is leaked when embedded in native Android application.
4+
15
## 12.0.1
26

37
* Fixes a bug where the `ignoreBatteryOptimizations` permission didn't report the correct status when the permission is requested and granted.

permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionHandlerPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
7575
binding.getActivity()
7676
);
7777

78-
this.pluginBinding = binding;
78+
pluginBinding = binding;
7979
registerListeners();
8080
}
8181

@@ -87,8 +87,8 @@ public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBindin
8787
@Override
8888
public void onDetachedFromActivity() {
8989
stopListeningToActivity();
90-
9190
deregisterListeners();
91+
pluginBinding = null;
9292
}
9393

9494
@Override

permission_handler_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: permission_handler_android
22
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
33
homepage: https://github.com/baseflow/flutter-permission-handler
4-
version: 12.0.1
4+
version: 12.0.2
55

66
environment:
77
sdk: ">=2.15.0 <4.0.0"

0 commit comments

Comments
 (0)