View Single Post
  #1  
Old 01-02-2017, 10:30 PM
Kirko Kirko is offline
Registered Guest
Join Date: Dec 2014
Location: Texas
Posts: 61
Kirko has a spectacular aura aboutKirko has a spectacular aura about
Anonymous functions don't delete

I noticed that these functions don't delete and are stored until I clearVars. Is this normal or should I be doing something to clear them? I tried to destroy the function after I use it but that didn't work.

PHP Code:
function onCreated() {
  
//this.clearVars(); // Will clear it

  
temp.fn = function(result) {
    
printf("Test: %d"result);
  };
  
test(55fn);

  
temp.fn.destroy();  // Function function_2107071_1.destroy not found at line 9

  
echo("Errors: " this.scriptErrors);
  echo(
"Useless crap: " getStringKeys("this.function").size()); // Goes up everyime script is updated
}


function 
test(abcallback) {
  (@ 
callback)(b);

Reply With Quote