Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2011, 11:48 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default Probably dispose of quest files on dynamic zone shutdown

My brain is fuzz topic should be 'properly'. Right now we leak the quest files after we shutdown a dynamic zone (eg. boots up, loads quests, shuts down). When we shutdown on the old code we just cleared the list, but all this data allocates memory before we load it in.

parser.cpp

New Code:
Code:
void Parser::ClearCache() {
#if Parser_DEBUG >= 2
	cout << "Parser::ClearCache" << endl;
#endif
	//for (int32 i=0; i<pMaxNPCID+1; i++)
	//	pNPCqstID[i] = -1;
	
	iter_events listIt = MainList.begin();
	Events *p;
	EventList *pp;
	while (listIt != MainList.end())
	{
		p = *listIt;
		if ( p )
		{
		iter_eventlist listIt2 = p->Event.begin();
			while (listIt2 != p->Event.end())
			{
				pp = *listIt2;
				if ( pp )
				safe_delete(pp);
				listIt2++;
			}
				listIt++;
				safe_delete(p);
		}
	}

	safe_delete_array(pNPCqstID);
	pNPCqstID = new sint32[1];
	npcarrayindex=1;
}
Old Code:
Code:
void Parser::ClearCache() {
#if Parser_DEBUG >= 2
        cout << "Parser::ClearCache" << endl;
#endif
        //for (int32 i=0; i<pMaxNPCID+1; i++)
        //      pNPCqstID[i] = -1;
        MainList.clear();
        safe_delete_array(pNPCqstID);
        pNPCqstID = new sint32[1];
        npcarrayindex=1;
}
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
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 10:44 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3