summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/t_timers.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-03-27 17:24:15 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-03-27 17:24:15 +0000
commitdeb10796ae4447c072fff33e2bb8bca2eeeb8ae6 (patch)
tree32bb075b7de205f87c71a4ebc0841e34ce424b66 /protocols/Telegram/src/t_timers.cpp
parent6e9ace645b7d24ed0fe60f4b7714d3bb11739dfc (diff)
Telegram: netlib network pt. 1
git-svn-id: http://svn.miranda-ng.org/main/trunk@16554 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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);
}