Patch for:

-Perl blessing of exported variables is causing the SVs to be overwritten but never freed by the Perl GC.  I'm not sure if this is a feature or a bug in Perl as the documentation sucks.

Addressed by setting the blessed SVs in question to be undefined at the end of every script.  Caused a noticeable drop in memory for zones with a lot of quest events firing but it's probably not perfect.
This commit is contained in:
KimLS 2013-04-01 14:23:54 -07:00
parent fb0add070b
commit 757fc01b78

View File

@ -158,6 +158,14 @@ void PerlXSParser::SendCommands(const char * pkgprefix, const char *event, uint3
//now call the requested sub
perl->dosub(std::string(pkgprefix).append("::").append(event).c_str());
#ifdef EMBPERL_XS_CLASSES
std::string eval_str = (std::string)"$" + (std::string)pkgprefix + (std::string)"::client = undef;";
eval_str += (std::string)"$" + (std::string)pkgprefix + (std::string)"::npc = undef;";
eval_str += (std::string)"$" + (std::string)pkgprefix + (std::string)"::questitem = undef;";
eval_str += (std::string)"$" + (std::string)pkgprefix + (std::string)"::entity_list = undef;";
perl->eval(eval_str.c_str());
#endif
} catch(const char * err) {
//try to reduce some of the console spam...