build system: fix open file leak

This commit is contained in:
KonaBlend 2016-04-06 17:41:22 -04:00
parent 613d6e8f7b
commit 8ae78da74e

View File

@ -467,8 +467,8 @@ PCH status: <%= c?(:USE_PRECOMPILED_HEADERS) ? "enabled" : "disabled" %>
def self.load_config
# puts "load #{@config_file}" if @verbose
config = JSON.load(@config_file.open) if @config_file.exist?
config = {} unless config
config = {}
config = @config_file.open { |f| JSON.load(f) } if @config_file.exist?
@htrace = config.fetch('htrace', @htrace)
@pretty = config.fetch('pretty', @pretty)
@db_scan = config.fetch('scan', @db_scan)