| 182 destroy_timeout_handler(PurplePerlTimeoutHandler *handler) |
182 destroy_timeout_handler(PurplePerlTimeoutHandler *handler) |
| 183 { |
183 { |
| 184 timeout_handlers = g_list_remove(timeout_handlers, handler); |
184 timeout_handlers = g_list_remove(timeout_handlers, handler); |
| 185 |
185 |
| 186 if (handler->iotag > 0) |
186 if (handler->iotag > 0) |
| 187 g_source_remove(handler->iotag); |
187 purple_timeout_remove(handler->iotag); |
| 188 |
188 |
| 189 if (handler->callback != NULL) |
189 if (handler->callback != NULL) |
| 190 SvREFCNT_dec(handler->callback); |
190 SvREFCNT_dec(handler->callback); |
| 191 |
191 |
| 192 if (handler->data != NULL) |
192 if (handler->data != NULL) |
| 403 handler->data = (data != NULL && data != &PL_sv_undef |
403 handler->data = (data != NULL && data != &PL_sv_undef |
| 404 ? newSVsv(data) : NULL); |
404 ? newSVsv(data) : NULL); |
| 405 |
405 |
| 406 timeout_handlers = g_list_append(timeout_handlers, handler); |
406 timeout_handlers = g_list_append(timeout_handlers, handler); |
| 407 |
407 |
| 408 handler->iotag = g_timeout_add(seconds * 1000, perl_timeout_cb, handler); |
408 handler->iotag = purple_timeout_add(seconds * 1000, perl_timeout_cb, handler); |
| 409 } |
409 } |
| 410 |
410 |
| 411 void |
411 void |
| 412 purple_perl_timeout_clear_for_plugin(PurplePlugin *plugin) |
412 purple_perl_timeout_clear_for_plugin(PurplePlugin *plugin) |
| 413 { |
413 { |