removed goroutine leak

This commit is contained in:
Stephen McQuay 2013-09-04 23:36:45 -07:00
parent fb0e6d92d7
commit c6b480fa1e

10
game.go
View File

@ -14,7 +14,6 @@ type game struct {
splosions map[*bot.Splosion]bool splosions map[*bot.Splosion]bool
register chan *player register chan *player
unregister chan *player unregister chan *player
robot_id chan int
turn int turn int
width, height float64 width, height float64
spectators map[*Spectator]bool spectators map[*Spectator]bool
@ -39,16 +38,7 @@ func NewGame(id string, width, height float64) *game {
sunregister: make(chan *Spectator), sunregister: make(chan *Spectator),
kill: make(chan bool, 128), kill: make(chan bool, 128),
} }
g.robot_id = make(chan int)
go func() {
for i := 0; ; i++ {
g.robot_id <- i
}
}()
return g return g
} }
func (g *game) run() { func (g *game) run() {