uiTimer() Use uiNew() and uiFree()
This commit is contained in:
parent
f921dde9f6
commit
5622b13c23
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue