Raised This Month: $51 Target: $400
 12% 

About destroying Array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-14-2013 , 08:46   About destroying Array
Reply With Quote #1

For example i create an array like: g_aArray = ArrayCreate( 32, 1 )
it is necessary to destroy g_aArray in plugin_end to prevent memory leak, or the server is already destroy array like in Trie case (also see #78 post) ?
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-14-2013 , 08:48   Re: About destroying Array
Reply With Quote #2

You don't need to destroy dynamic arrays or tries, it is done internally.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-14-2013 , 08:51   Re: About destroying Array
Reply With Quote #3

Hmm .. for curiosity where can i found these ? in amxx source ?

Anyway thanks for reply, now it's ok.
Thanks.

Last edited by dFF; 07-14-2013 at 08:56.
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-14-2013 , 10:19   Re: About destroying Array
Reply With Quote #4

meta_api.cpp

Code:
// Very	first point	at map load
// Load	AMX	modules	for	new	native functions
// Initialize AMX stuff	and	load it's plugins from plugins.ini list
// Call	precache forward function from plugins
int	C_Spawn(edict_t *pent)
Arrays :
Code:
	for (unsigned int i=0; i<VectorHolder.size(); i++)
	{
		delete VectorHolder[i];
	};
	VectorHolder.clear();
Tries :
Code:
	g_TrieHandles.clear();
So, you can delete at plugin_end() but it is not required because it is deleted at new map.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-14-2013 , 10:32   Re: About destroying Array
Reply With Quote #5

Thank you !
dFF is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode