lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thank you both for your help, it works but sometimes I get stack
overflows. I am not sure what causes it. Here is the code I use:

function HandleEvent (event, ...)
  for pkg, moddy in pairs(package.loaded) do
    if ModulesLoaded[pkg] and type(moddy[event]) == "function" then
        moddy[event](...)
    end
  end
end

ModulesLoaded is a table that tracks the modules (thanks to Luiz for
pointing me to this direction.)

-- 
Gergo Szakal <bastyaelvtars@gmail.com>