Where is that delete... ConnectionManager?

Asked by Crise / MW

This is something that has been bothering me for a while now... so it just might be that I am blind and asking something really stupid here, so bear with me.

The thing is ConnectionManager::getConnection creates a new UserConnection object which of course is right, but the question is why doesn't ConnectionManager::putConnection delete that object? Also where is that object deleted then exactly, if its not supposed to be deleted there?

I know that there is a delete in the catch part for the try blocks for accept, connect, etc. but why only there... am I really supposed to believe that when everything goes brilliantly without any errors for a connection that then the allocated memory gets freed correctly.

I might be missing something obvious here (the fact that it's 3 am in the morning doesn't help), but if that's the case then I sure would like to know what that something is.

Question information

Language:
English Edit question
Status:
Answered
For:
DC++ Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jacek Sieka (arnetheduck) said :
#1

void UserConnection::on(Failed, const string& aLine) throw()

Can you help with this problem?

Provide an answer of your own, or ask Crise / MW for more information if necessary.

To post a message you must log in.