소스 검색

Improve app-browser.go

Daniel Salvadori 6 년 전
부모
커밋
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