You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix mem pool leak in lwipClient with shared_ptr with custom deleter.
for lwipClient created from lwipServer the deleter doesn't free the struct. server releases the clients it manages. it would be better if the server used an array of lwipClient objects. then the shared_ptr in them would hold the pointer. maybe in a follow up PR if this is merged.
I'm not seeing it. Sure using a std::shared_ptr would be a pretty clean solution, but you could always just call delete (or mem_free) in the Destructor. Having a mem_alloc (a C function) inside of reset (a member of a C++ template class) just feels super weird. What do you think?
you could always just call delete (or mem_free) in the Destructor.
no. Client must be copyable. multiple copies of Client can point to the same TCP connection
having a mem_alloc (a C function) inside of reset (a member of a C++ template class) just feels super weird
not really. the resetfunction is just a assignment which allows to specify a deleter. uses of shared_ptr should be written as close as possible as with a basic pointer
no. tcp_client is not a class
and WiFiClient is never deleted from LwipClent pointer and it even doesn't make sense to do new for WiFiClient. that is why Arduino is not really missing the virtual destructor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix mem pool leak in lwipClient with shared_ptr with custom deleter.
for lwipClient created from lwipServer the deleter doesn't free the struct. server releases the clients it manages. it would be better if the server used an array of lwipClient objects. then the shared_ptr in them would hold the pointer. maybe in a follow up PR if this is merged.