memleak fix
This commit is contained in:
@ -21,6 +21,7 @@ func (g *GameState) Do(f func()) {
|
||||
done := make(chan struct{}, 1)
|
||||
g.Mainfunc <- func() {
|
||||
f()
|
||||
f = nil //zero pointer for closure function
|
||||
done <- struct{}{}
|
||||
}
|
||||
<-done
|
||||
|
Reference in New Issue
Block a user