Delete register_on_mods_loaded callbacks when not required.

This commit is contained in:
luk3yx 2019-07-27 17:59:41 +12:00
parent 77e285b98a
commit acecf727e2
1 changed files with 2 additions and 1 deletions

View File

@ -66,12 +66,13 @@ print('Hello from the server-sent CSMs!')
do
local funcs = {}
function sscsm.register_on_mods_loaded(callback)
table.insert(funcs, callback)
if funcs then table.insert(funcs, callback) end
end
function sscsm._done_loading_()
sscsm._done_loading_ = nil
for _, func in ipairs(funcs) do func() end
funcs = nil
end
end