summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/t_timers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src/t_timers.cpp')
-rw-r--r--protocols/Telegram/src/t_timers.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/protocols/Telegram/src/t_timers.cpp b/protocols/Telegram/src/t_timers.cpp
index c897247fab..296242856d 100644
--- a/protocols/Telegram/src/t_timers.cpp
+++ b/protocols/Telegram/src/t_timers.cpp
@@ -11,10 +11,7 @@ struct tgl_timer
HANDLE hTimer;
};
-VOID CALLBACK WaitOrTimerCallback(
- _In_ PVOID lpParameter,
- _In_ BOOLEAN TimerOrWaitFired
- )
+VOID CALLBACK WaitOrTimerCallback(_In_ PVOID lpParameter, _In_ BOOLEAN TimerOrWaitFired)
{
tgl_timer *p = (tgl_timer*)lpParameter;
p->cb(p->TLS, p->arg);
@@ -24,7 +21,7 @@ VOID CALLBACK WaitOrTimerCallback(
struct tgl_timer *mtgl_timer_alloc (struct tgl_state *TLS, void (*cb)(struct tgl_state *TLS, void *arg), void *arg)
{
- tgl_timer *p = (tgl_timer *)calloc(sizeof (tgl_timer), 1);
+ tgl_timer *p = (tgl_timer *)mir_calloc(sizeof (tgl_timer));
p->TLS = TLS;
p->cb = cb;
p->arg = arg;
@@ -38,7 +35,8 @@ void mtgl_timer_insert (struct tgl_timer *t, double p)
t->hTimer = hNewTimer;
}
-void mtgl_timer_delete (struct tgl_timer *t) {
+void mtgl_timer_delete (struct tgl_timer *t)
+{
DeleteTimerQueueTimer(hQueue, t->hTimer, 0);
t->hTimer = 0;
}
@@ -46,7 +44,7 @@ void mtgl_timer_delete (struct tgl_timer *t) {
void mtgl_timer_free (struct tgl_timer *t)
{
if (t->hTimer) mtgl_timer_delete(t);
- free(t);
+ mir_free(t);
}