Add timer ID attribute, for safe cleanup in the scripted environment

This commit is contained in:
Sergey Lyubka committed 2022-07-17 12:52:30 +01:00
1 parent 1fbf534f9a
commit 4a3d760c06
6 files changed
+12 -6

No files matched your search

+1
View File
@@ -224,6 +224,7 @@ struct mg_timer *mg_timer_add(struct mg_mgr *mgr, uint64_t milliseconds,
unsigned flags, void (*fn)(void *), void *arg) {
struct mg_timer *t = (struct mg_timer *) calloc(1, sizeof(*t));
mg_timer_init(&mgr->timers, t, milliseconds, flags, fn, arg);
t->id = mgr->timerid++;
return t;
}