Main initialization is done inside radio.sp and radio/file.inc, everything else is reading from the method maps outside them 2 files.
Going to also run over all the code tonight and tomorrow, see if anything is incorrectly done. Add the couple of changes you recommended.
Thanks Neuro Toxin and blackhawk for helping with this.
Edit: I can't actually check IsValid on a Collection. Was thinking if using something along the lines of:
Code:
if (Collection.Count > 0)
LogMessage("Memory leak detected. Dispose on g_Collection failed.");
Would be a viable alternative?
Cheers
Edit 2: Think i might have found a possible solution but would love some feedback.
Was looking over Dynamics sourcecode and noticed you have Collection.Clear to call Dispose over each member within a Collection.
Instead of doing:
Code:
Collection.Dispose(true);
Think i need to change it to:
Code:
// This appears to cycle over each member of the collection and call Dispose, instead of calling Dispose directly on the collection.
Collection.Clear(true);
Then possibly initialize the Collections at plugin start and only call Clear on each map end.
Would need to dig further into the sourcecode to understand how this works exactly. Going to look into this more tomorrow, It's almost 1am here.
Cheers
__________________