Holy memory leak batman

I found a memory leak. Which is funny given my statement before about there being no known memory leaks.

Well anyway down to the nuts and bolts. The issue was that even though the API docs for enet say once you pass an enet packet to the api to send you don't need to worry about it. As a matter of fact it says you should not use destroy packet on it. However it would appear that it doesn't actually clean up the data in the packet.

This is unfortunate however now that I know this I can work around it. Right now I'm flushing after the send call and then calling a delete on the pointer in the message union. The flushing ensures it has actually sent it and should be done with it more or less. However at this point I'm kind of guessing it makes a copy of your data. Otherwise it makes no sense that it wouldn't be cleaned up except if it was keeping it in case of a packet loss. In which case it should clean it up after the other other system responds.

But anyway so that memory leak is fixed. There is however a smaller memory leak somewhere else in the client code. However the server appears to have no memory leaks at this time(fingers crossed). The client leak could be about anywhere though I haven't figured out what event it corresponds to but it is relatively infrequent. It could be in one of my custom scene nodes or something.


Popular posts from this blog

VK9 - Milestone8 Completed

VK9 - Milestone13 Completed

VK9 - Milestone16 Completed