Skip to content

Commit efef961

Browse files
committed
feat: add timer strong retainer annotation
1 parent 022893f commit efef961

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

NativeScript/runtime/Timers.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,16 @@ void Timers::SetTimer(const v8::FunctionCallbackInfo<v8::Value>& args, bool repe
206206
otherArgLength);
207207
for (int i = 0; i < otherArgLength; i++) {
208208
(*argArray)[i] = std::make_shared<Persistent<Value>>(isolate, args[i + 2]);
209+
#ifdef DEBUG
210+
(*argArray)[i]->AnnotateStrongRetainer("timer_argument");
211+
#endif
209212
}
210213
}
211214

212215
auto task = std::make_shared<TimerTask>(isolate, handler, timeout, repeatable, argArray, id, now_ms());
216+
#ifdef DEBUG
217+
task->callback_.AnnotateStrongRetainer("timer");
218+
#endif
213219
task->repeats_ = repeatable;
214220

215221
CFRunLoopTimerContext timerContext = {0, NULL, NULL, NULL, NULL};

0 commit comments

Comments
 (0)