소스 검색

jsre: timer bugfix when clearInterval was called from within the callback

Bas van Kervel 10 년 전
부모
커밋
2f65ddc501
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      jsre/jsre.go

+ 3 - 1
jsre/jsre.go

@@ -154,7 +154,9 @@ loop:
 			if err != nil {
 				fmt.Println("js error:", err, arguments)
 			}
-			if timer.interval {
+		
+			_, inreg := registry[timer] // when clearInterval is called from within the callback don't reset it
+			if timer.interval && inreg {
 				timer.timer.Reset(timer.duration)
 			} else {
 				delete(registry, timer)