Dup the forwarded ports array while destroying to avoid issues with changes in virtualbox gem and deleting in place

This commit is contained in:
Mitchell Hashimoto 2010-06-03 12:04:21 -07:00
parent abf6a50b5a
commit 1e01514c4f
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ module Vagrant
def clear
logger.info "Deleting any previously set forwarded ports..."
@runner.vm.forwarded_ports.collect { |p| p.destroy }
fp = @runner.vm.forwarded_ports.dup
fp.collect { |p| p.destroy }
@runner.reload!
end