libpurple/plugins/perl/perl-handlers.c

changeset 16140
362e0ca15d3a
parent 15884
4de1981757fc
child 16238
33bf2fd32108
child 17570
4cca2fc0ec83
child 18068
b6554e3c8224
child 20478
46933dc62880
equal deleted inserted replaced
16139:3fe11fe6c4f8 16140:362e0ca15d3a
181 static void 181 static void
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)
187 g_source_remove(handler->iotag);
188
186 if (handler->callback != NULL) 189 if (handler->callback != NULL)
187 SvREFCNT_dec(handler->callback); 190 SvREFCNT_dec(handler->callback);
188 191
189 if (handler->data != NULL) 192 if (handler->data != NULL)
190 SvREFCNT_dec(handler->data); 193 SvREFCNT_dec(handler->data);
205 208
206 g_free(handler->signal); 209 g_free(handler->signal);
207 g_free(handler); 210 g_free(handler);
208 } 211 }
209 212
210 static int 213 static gboolean
211 perl_timeout_cb(gpointer data) 214 perl_timeout_cb(gpointer data)
212 { 215 {
213 PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data; 216 PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data;
214 217
215 dSP; 218 dSP;
223 226
224 PUTBACK; 227 PUTBACK;
225 FREETMPS; 228 FREETMPS;
226 LEAVE; 229 LEAVE;
227 230
231 /* We're returning FALSE, so no need to manually remove the source */
232 handler->iotag = 0;
233
228 destroy_timeout_handler(handler); 234 destroy_timeout_handler(handler);
229 235
230 return 0; 236 return FALSE;
231 } 237 }
232 238
233 typedef void *DATATYPE; 239 typedef void *DATATYPE;
234 240
235 static void * 241 static void *

mercurial