Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
[main] make main() no-op when called again
Browse files Browse the repository at this point in the history
Fix #390

Suggested by @davidcarlisle.
  • Loading branch information
phi-gamma committed Jan 29, 2017
1 parent 17a5da0 commit 0baccc9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/luaotfload-main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,18 @@ local install_loaders = function ()
return loaders
end

local luaotfload_initialized = false --- prevent multiple invocations

luaotfload.main = function ()

if luaotfload_initialized then
logreport ("log", 0, "load",
"Luaotfload initialization requested but is already \z
loaded, ignoring.")
return
end
luaotfload_initialized = true

luaotfload.loaders = install_loaders ()
local loaders = luaotfload.loaders
local loadmodule = loaders.luaotfload
Expand Down

0 comments on commit 0baccc9

Please sign in to comment.