1function mcp_config_pools() 2 return true 3end 4 5local result_leak = {} 6-- Do specialized testing based on the key prefix. 7function mcp_config_routes(zones) 8 mcp.attach(mcp.CMD_ANY_STORAGE, function(r) 9 local cmd = r:command() 10 if cmd == mcp.CMD_GET or cmd == mcp.CMD_MG then 11 -- marking the object as <close> will clean up its internal 12 -- references as soon as it drops out of scope. 13 -- it is an error to try to use this 'res' outside of this 'if' 14 -- statement! 15 local res <close> = mcp.internal(r) 16 local res2 = mcp.internal(r) 17 res2:close() -- test manual closing. 18 -- uncomment to test effects of leaking a res obj 19 table.insert(result_leak, res) 20 end 21 return mcp.internal(r) 22 end) 23end 24