Delete register_on_mods_loaded callbacks when not required.
This commit is contained in:
parent
77e285b98a
commit
acecf727e2
|
@ -66,12 +66,13 @@ print('Hello from the server-sent CSMs!')
|
||||||
do
|
do
|
||||||
local funcs = {}
|
local funcs = {}
|
||||||
function sscsm.register_on_mods_loaded(callback)
|
function sscsm.register_on_mods_loaded(callback)
|
||||||
table.insert(funcs, callback)
|
if funcs then table.insert(funcs, callback) end
|
||||||
end
|
end
|
||||||
|
|
||||||
function sscsm._done_loading_()
|
function sscsm._done_loading_()
|
||||||
sscsm._done_loading_ = nil
|
sscsm._done_loading_ = nil
|
||||||
for _, func in ipairs(funcs) do func() end
|
for _, func in ipairs(funcs) do func() end
|
||||||
|
funcs = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue