Skip to content

Conversation

@okaestne
Copy link
Contributor

@okaestne okaestne commented Nov 5, 2022

This PR addresses two smaller issues that I found using valgrind:

  1. routing/Trie: use object references instead of raw pointers

    This way, we don't need to free the Trie when stopping the program (what we don't do right now).
    Also remove unused get_size method and simplify code a bit.

  2. http_connection: initialize task_id_

The former change addresses one of the leaks mentioned in #546. The other one, that is caused in do_accept by creating new Connection objects for every request seems to be harder to solve. This one should really be addressed, as it leaks around 5KB for every request.

this fixes some memory leaks.
also remove unused `get_size` method.
@mrozigor mrozigor merged commit 84ec783 into CrowCpp:master Nov 8, 2022
@kwach
Copy link

kwach commented Jan 26, 2023

Is there anything prohibiting this PR to be accepted? I've hit mem and connection leaks as well and I'd be interested to see this merged :D

@okaestne okaestne deleted the fix-memleaks branch July 6, 2023 21:16
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