Skip to content

Memory leak fixes - #3816

Merged
ethomson merged 3 commits into
libgit2:masterfrom
pks-t:pks/memory-leaks
Jun 14, 2016
Merged

Memory leak fixes#3816
ethomson merged 3 commits into
libgit2:masterfrom
pks-t:pks/memory-leaks

Conversation

@pks-t

@pks-t pks-t commented Jun 7, 2016

Copy link
Copy Markdown
Member

This fixes all memory leaks displayed by AppVeyor's debug CRT. The winhttp-related plug is the only actual fix for memory leaks inside of libgit2 and not its tests.

pks-t added 3 commits June 7, 2016 12:29
The thread local storage is used to hold some global state that
is dynamically allocated and should be freed upon exit. On
Windows, we clean up the C run-time right after execution of
registered shutdown callbacks and before cleaning up the TLS.

When we clean up the CRT, we also cause it to analyze for memory
leaks. As we did not free the TLS yet this will lead to false
positives.

Fix the issue by first freeing the TLS and cleaning up the CRT
only afterwards.
@ethomson

Copy link
Copy Markdown
Member

Thanks again for tackling these. ❤️

@ethomson
ethomson merged commit 2a09de9 into libgit2:master Jun 14, 2016
@pks-t
pks-t deleted the pks/memory-leaks branch June 21, 2016 05:44
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.

2 participants