aboutsummaryrefslogtreecommitdiff
path: root/io/init.lua
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-26 23:58:32 +0800
committerDeterminant <[email protected]>2015-05-26 23:58:32 +0800
commitf8543464c13584e39bfacee694ee1ed80ac121f4 (patch)
tree3e29ffd5205659fbf3f908b5406522e4bab1c2e9 /io/init.lua
parent910640c0ef7c43d586180241f79723973e0e7d35 (diff)
fix a severe bug in memory management of userdata
Diffstat (limited to 'io/init.lua')
-rw-r--r--io/init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/io/init.lua b/io/init.lua
index d96f062..dc1c6c3 100644
--- a/io/init.lua
+++ b/io/init.lua
@@ -22,7 +22,8 @@ function nerv.ParamFile:read_param(id)
if metadata == nil then
nerv_error("param with id %s does not exist", id)
end
- local param = assert(loadstring("return " .. metadata.type .. "(" .. id .. ")"))()
+ local param = assert(loadstring("return " ..
+ metadata.type .. "(\"" .. id .. "\")"))()
param:set_info(metadata.info)
param:read(self:get_chunkdata(id))
return param