Skip to content

fix crash on indication when only gattlib_register_indication() is used - #296

Open
rdmeneze wants to merge 1 commit into
labapart:masterfrom
rdmeneze:fix/indication-thread-pool-crash
Open

fix crash on indication when only gattlib_register_indication() is used#296
rdmeneze wants to merge 1 commit into
labapart:masterfrom
rdmeneze:fix/indication-thread-pool-crash

Conversation

@rdmeneze

Copy link
Copy Markdown

Indications were being routed through gattlib_on_gatt_notification(), which asserts on connection->notification.thread_pool. That pool only gets created if you called gattlib_register_notification() - if your app only does indications (gattlib_register_indication()), that pool is still NULL and the first real indication crashes the process.

Added a gattlib_on_gatt_indication() that uses the indication thread pool instead, and wired the indication signal handler to call that.

Indications were being routed through gattlib_on_gatt_notification(),
which asserts on connection->notification.thread_pool. That pool only
gets created if you called gattlib_register_notification() - if your
app only does indications (gattlib_register_indication()), that pool
is still NULL and the first real indication crashes the process.

Added a gattlib_on_gatt_indication() that uses the indication thread
pool instead, and wired the indication signal handler to call that.

Signed-off-by: Rafael Dias <rdmeneze@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant