Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leak errors #216

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

fix memory leak errors #216

wants to merge 5 commits into from

Conversation

chenbinn
Copy link

"{&sv}" format string in loop, no need free the key. see "https://developer.gnome.org/glib/stable/gvariant-format-strings.html" section "Characters: &".

@kaifastromai
Copy link

I would strongly recommend merging this commit. It fixes a really annoying 'memory freeing' bug.

@luknowak
Copy link

Hi @oliviermartin, would you be able to merge this pull request, which fixes a big memory leak, please?
It's enough to run gattlib_connect() and gattlib_disconnect() in a loop, to leak over 8MB in every iteration. Such leak makes it impossible to use the library for any long-running apps.
Thanks.

@luknowak
Copy link

There is an additional memory leak, not covered by this pull request, which needs to be fixed. When gattlib_connect() is called with adapter=NULL, and something fails in the function (e.g. device fails to connect), the default adapter is not being closed - the gattlib_adapter_close() is called only when the adapter is provided by the caller.

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.

3 participants