![]() |
memory leak.
from nodemachine.cpp file:
Code:
void |
Re: memory leak.
hey stefan, here you might see the advantages of using ctors and dtors :P
|
Re: memory leak.
another minor leak:
bot.cpp:64: Code:
char *message = (char *) malloc (64 * sizeof (char)); |
Re: memory leak.
@Josh, it should be freed when the DLL is unloaded. I am not sure how to do that... Actually thats probably of very old NNBot Ditlew's Radio interception messages and stuff :)
|
Re: memory leak.
yea, it's from the radio messages stuff, could you do it in Meta_Detach? along with FreeVisibilityTable? HTH
|
Re: memory leak.
doh! Done.
|
Re: memory leak.
FreeVisibilityTable should be freed in ServerDeactivate().
and the Meta_Detach() isn't get called if we exit the game normally and not use metamod command to unload the plugin. The correct place to free it is in DllMain() (windows) and _fini() (linux) also why not use "char message[64];" ? That's exactly same as the malloc thing and we don't need to care about freeing the memory |
Re: memory leak.
I don't know about 'message', it is very (very!) old code i once got from Ditlew (NNBot), so i just litterally took it over. I bet it can be improved here.
Are you sure the memory is not being freed even when exiting the game? How does metamod itself free itself then? (and all its plugins). |
Re: memory leak.
I once added a "assert(false)" in the Meta_Detach() function and only when I use metamod command to unload the plugin it bombs out.
|
Re: memory leak.
hmm, well i guess metamod needs some fix up there too then ;) Anyway, thx for the tip! I will work on it when i have time today; i have a lot of cleaning to do before my gf comes by.. :)
|
All times are GMT +2. The time now is 03:15. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.