Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let core.get_mod_storage be called multiple times #12572

Merged
merged 5 commits into from
Jul 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve builtin/common/storage.lua comment
Co-authored-by: sfan5 <[email protected]>
  • Loading branch information
TurkeyMcMac and sfan5 committed Jul 22, 2022
commit 6eb449fac0df3ca68f02d71506ac25fa19b417a7
2 changes: 1 addition & 1 deletion builtin/common/storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local get_current_modname = core.get_current_modname
local old_get_mod_storage = core.get_mod_storage

local storages = setmetatable({}, {
__mode = "v", -- Storages can be remade after being garbage-collected.
__mode = "v", -- values are weak references (can be garbage-collected)
__index = function(self, modname)
local storage = old_get_mod_storage(modname)
self[modname] = storage
Expand Down