Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Fix phantom delegate trying to use its referenced gatt instance#41

Open
smoy wants to merge 1 commit intoxamarin:masterfrom
smoy:discover_service_crashes
Open

Fix phantom delegate trying to use its referenced gatt instance#41
smoy wants to merge 1 commit intoxamarin:masterfrom
smoy:discover_service_crashes

Conversation

@smoy
Copy link

@smoy smoy commented May 13, 2015

Prior to the change, when one disconnect a connected device in Android,
Device instance inserts a delegate to GattCallback instance to cache
discovered Services. However, when one disconnects such device, the
delegate is not removed. So upon next device connection, that delegate
will attempt to reference a disposed Gatt instance and cause a crash.

To reproduce this bug, you can try the following sequence:

  1. Scan for Devices
  2. Connect to Device A
  3. Discovers Service of Device A
  4. Dsiconnect Device A
  5. Connect to Device A again
  6. Discovers Service of Device A
  7. Crash

Prior to the change, when one disconnect a connected device in Android,
Device instance inserts a delegate to GattCallback instance to cache
discovered Services. However, when one disconnects such device, the
delegate is not removed. So upon next device connection, that delegate
will attempt to reference a disposed Gatt instance and cause a crash.

To reproduce this bug, you can try the following sequence:

1) Scan for Devices
2) Connect to Device A
3) Discovers Service of Device A
4) Dsiconnect Device A
5) Connect to Device A again
6) Discovers Service of Device A
7) Crash
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant