Explorar el Código

Fixed a memory leak in the script engine

Returning NPC variables in a user defined script function inside the same NPC does not require to allocate any additional stack.

Fixes #1205

Thanks to @Jeybla
Lemongrass3110 hace 7 años
padre
commit
dce6ff1bea
Se han modificado 1 ficheros con 0 adiciones y 7 borrados
  1. 0 7
      src/map/script.c

+ 0 - 7
src/map/script.c

@@ -5623,13 +5623,6 @@ BUILDIN_FUNC(return)
 					get_val(st, data); // current scope, convert to value
 				if( data->ref && data->ref->vars == st->stack->stack_data[st->stack->defsp-1].u.ri->scope.vars )
 					data->ref = NULL; // Reference to the parent scope, remove reference pointer
-			} else if( name[0] == '.' && !data->ref ) { // script variable, link to current script
-				data->ref = (struct reg_db *)aCalloc(sizeof(struct reg_db), 1);
-				data->ref->vars = st->script->local.vars;
-
-				if (!st->script->local.arrays)
-					st->script->local.arrays = idb_alloc(DB_OPT_BASE);
-				data->ref->arrays = st->script->local.arrays;
 			}
 		}
 	}