Attempting to repair an order object leak.

Now frees manager_order objects in the reaction_list when the plugin is disabled or the world unloaded.  However, there may still be orders leaked elsewhere.
develop
Eric Wald 2014-05-04 12:35:10 -06:00
parent 5fb87c2ea9
commit 723cfcf28e
1 changed files with 4 additions and 0 deletions

@ -30,6 +30,10 @@ end
-- Clear all caches. -- Clear all caches.
-- Called when a world is loaded, or when the plugin is disabled. -- Called when a world is loaded, or when the plugin is disabled.
function clear_caches() function clear_caches()
-- Free the C++ objects in the reaction list.
for _, value in ipairs(reaction_list) do
value.order:delete()
end
reaction_list = {} reaction_list = {}
saved_orders = {} saved_orders = {}
jobs_to_create = {} jobs_to_create = {}