From 9162819daf992a8a019f36cd6bdb2bbebcdbe0ff Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 11 Jun 2013 11:10:08 -0700 Subject: [PATCH] packer/plugin: Avoid lexical scoping issues with cleaning up clients --- packer/plugin/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packer/plugin/client.go b/packer/plugin/client.go index 6890875f7..c81159a84 100644 --- a/packer/plugin/client.go +++ b/packer/plugin/client.go @@ -67,10 +67,10 @@ func CleanupClients() { for _, client := range managedClients { wg.Add(1) - go func() { + go func(client *Client) { client.Kill() wg.Done() - }() + }(client) } log.Println("waiting for all plugin processes to complete...")