Tab: ensure file is closed after reading
This commit is contained in:
parent
3716dae0ce
commit
a8fe03f72b
@ -29,7 +29,7 @@ class Tab < OpenStruct
|
||||
end
|
||||
|
||||
def self.from_file path
|
||||
tab = Tab.new Utils::JSON.load(open(path).read)
|
||||
tab = Tab.new Utils::JSON.load(File.read(path))
|
||||
tab.tabfile = path
|
||||
tab
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user