Skip to content

Commit 1093c7c

Browse files
Merge pull request #1337 from CaptainJeff/master
fix: removing event listeners in invalidate
2 parents 9623285 + 136a797 commit 1093c7c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

android/src/main/java/it/innove/BleManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,11 @@ public void removeListeners(double count) {
972972

973973
@Override
974974
public void invalidate() {
975+
try {
976+
context.unregisterReceiver(mReceiver);
977+
} catch (Exception e) {
978+
Log.e(LOG_TAG, "Receiver not registered or already unregistered", e);
979+
}
975980
try {
976981
// Disconnect all known peripherals, otherwise android system will think we are still connected
977982
// while we have lost the gatt instance

0 commit comments

Comments
 (0)