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

Memory leaks in HTTPConnection2.cpp #44

Open
Tomash667 opened this issue Dec 28, 2018 · 2 comments
Open

Memory leaks in HTTPConnection2.cpp #44

Tomash667 opened this issue Dec 28, 2018 · 2 comments

Comments

@Tomash667
Copy link

HTTPConnection2 have some memory leaks. After adding request it must be processed and then user have to get response, otherwise it will leak (for example user quit game before response is received or processed).

Example solution:

HTTPConnection2::~HTTPConnection2()
{
	for(unsigned int i = 0, count = pendingRequests.Size(); i < count; ++i)
		SLNet::OP_DELETE(pendingRequests[i], _FILE_AND_LINE_);
	for(unsigned int i = 0, count = sentRequests.Size(); i < count; ++i)
		SLNet::OP_DELETE(sentRequests[i], _FILE_AND_LINE_);
	for(unsigned int i = 0, count = completedRequests.Size(); i < count; ++i)
		SLNet::OP_DELETE(completedRequests[i], _FILE_AND_LINE_);
}

I hereby declare I've read and agree to the current CLA as provided under https://github.com/SLikeSoft/SLikeNet/blob/master/.github/CONTRIBUTING.md

@Luke1410
Copy link
Member

Luke1410 commented Jan 6, 2019

Hi Tomash, thanks for the report and the suggested fix. I've applied a variant of the suggested code change to the current trunk/master and the fix should be integrated in the next version of SLikeNet.

Internal issue number: SLNET-259.

Do you want to be listed in the acknowledgment section of the accompanied readme file as well for your contribution?

@Tomash667
Copy link
Author

Sure, why not.

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

No branches or pull requests

2 participants