I find killTrigger() do delete the created temp trigger but the count of trigger report in statics will not get decreased.
Is that mean killTrigger() will not physically delete a temp trigger and allocated memory can not be released until reload the whole LUA env?
statics of temp triggers
Re: statics of temp triggers
I have such question because I find reload module spends quiet a long time(even get the mudlet hung) each time my robot keep on running for several days(a lot of temp triggers add/remove occurred)
Re: statics of temp triggers
They're deleted in bulk when the next line is processed, as an optimization.
Re: statics of temp triggers
I may find the root cause of mudlet hung during reload process.
The issue can be easily reproduced by the command below:
I think the issue is introduced by the function reloadModule(). The above issue reproduce can be avoided if I change the code to:
Besides, the resetProfile() has another issue that mudlet may get crash if directly running reloadModule() without resetProfile() before it.
The issue can be easily reproduced by the command below:
Code: Select all
for i=1,50000 do
id = tempTrigger("test", "")
killTrigger(id)
end
resetProfile()
reloadModule(<test module>)
Code: Select all
for i=1,50000 do
id = tempTrigger("test", "")
killTrigger(id)
end
uninstallModule(<test module>)
resetProfile()
installModule(<test module.xml>)
Re: statics of temp triggers
OK, put it on https://github.com/Mudlet/Mudlet/issues/new please with a module to reproduce it with.