executeElapsed gets stuck returning TRUE even when nothing was executed

Fixes #1278
This commit is contained in:
Joe Cheng
2016-08-10 14:50:46 -07:00
parent d1e4483f98
commit fdb52e0243
3 changed files with 34 additions and 1 deletions

View File

@@ -22,6 +22,11 @@ TimerCallbacks <- R6Class(
.times <<- data.frame()
},
schedule = function(millis, func) {
# If args could fail to evaluate, let's make them do that before
# we change any state
force(millis)
force(func)
id <- .nextId
.nextId <<- .nextId + 1L
@@ -56,7 +61,7 @@ TimerCallbacks <- R6Class(
},
executeElapsed = function() {
elapsed <- takeElapsed()
if (length(elapsed) == 0)
if (nrow(elapsed) == 0)
return(FALSE)
for (id in elapsed$id) {