libpurple/plugins/perl/perl-handlers.c

branch
release-2.1.0
changeset 18165
fb6f9d0130aa
parent 17570
4cca2fc0ec83
child 19336
065a79d2d0e5
equal deleted inserted replaced
18164:1e86dedf48be 18165:fb6f9d0130aa
212 212
213 static gboolean 213 static gboolean
214 perl_timeout_cb(gpointer data) 214 perl_timeout_cb(gpointer data)
215 { 215 {
216 PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data; 216 PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data;
217 gboolean ret = FALSE;
217 218
218 dSP; 219 dSP;
219 ENTER; 220 ENTER;
220 SAVETMPS; 221 SAVETMPS;
221 PUSHMARK(sp); 222 PUSHMARK(sp);
222 XPUSHs((SV *)handler->data); 223 XPUSHs((SV *)handler->data);
223 PUTBACK; 224 PUTBACK;
224 call_sv(handler->callback, G_EVAL | G_SCALAR); 225 call_sv(handler->callback, G_EVAL | G_SCALAR);
225 SPAGAIN; 226 SPAGAIN;
226 227
228 ret = POPi;
229
227 PUTBACK; 230 PUTBACK;
228 FREETMPS; 231 FREETMPS;
229 LEAVE; 232 LEAVE;
230 233
231 /* We're returning FALSE, so no need to manually remove the source */ 234 if (ret == FALSE)
232 handler->iotag = 0; 235 destroy_timeout_handler(handler);
233 236
234 destroy_timeout_handler(handler); 237 return ret;
235
236 return FALSE;
237 } 238 }
238 239
239 typedef void *DATATYPE; 240 typedef void *DATATYPE;
240 241
241 static void * 242 static void *

mercurial