Daniel Salvadori 6 лет назад
Родитель
Сommit
6787e56af6
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/app-browser.go

+ 3 - 1
app/app-browser.go

@@ -59,7 +59,7 @@ func App() *Application {
 func (a *Application) Run(update func(rend *renderer.Renderer, deltaTime time.Duration)) {
 
 	// Create channel so later we can prevent application from finishing while we wait for callbacks
-	done := make(chan bool, 0)
+	done := make(chan bool)
 
 	// Initialize start and frame time
 	a.startTime = time.Now()
@@ -83,6 +83,8 @@ func (a *Application) Run(update func(rend *renderer.Renderer, deltaTime time.Du
 		}
 		return nil
 	})
+	defer tick.Release()
+
 	a.cbid = js.Global().Call("requestAnimationFrame", tick)
 
 	// Read from done channel