uiTimer() Use uiNew() and uiFree()

This commit is contained in:
cody271 2018-04-16 17:49:08 -07:00
parent f921dde9f6
commit 5622b13c23
1 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ static gboolean dotimer(gpointer data)
if((*(t->f))(t->data)) if((*(t->f))(t->data))
return TRUE; return TRUE;
else { else {
g_free(t); uiFree(t);
return FALSE; return FALSE;
} }
} }
@ -128,7 +128,7 @@ void uiTimer(int milliseconds, int (*f)(void *data), void *data)
{ {
struct timer *t; struct timer *t;
t = g_new0(struct timer, 1); t = uiNew(struct timer);
t->f = f; t->f = f;
t->data = data; t->data = data;
g_timeout_add(milliseconds, dotimer, t); g_timeout_add(milliseconds, dotimer, t);