static void
sessionCloseImplFinish (tr_session * session)
{
+ event_free (session->saveTimer);
+ session->saveTimer = NULL;
+
/* we had to wait until UDP trackers were closed before closing these: */
evdns_base_free (session->evdns_base, 0);
session->evdns_base = NULL;
break;
}
- if (!err && (!top->type || !tr_ptrArrayEmpty(&stack)))
+ if (err == 0 && (top->type == 0 || !tr_ptrArrayEmpty(&stack)))
err = EILSEQ;
- if (!err && setme_end)
- *setme_end = (const char*) buf;
+ if (err == 0)
+ {
+ if (setme_end != NULL)
+ *setme_end = (const char*) buf;
+ }
+ else if (top->type != 0)
+ {
+ tr_variantFree (top);
+ tr_variantInit (top, 0);
+ }
tr_ptrArrayDestruct (&stack, NULL);
return err;
check (wd != NULL);
check (tr_sys_path_is_same (test_dir, tr_watchdir_get_path (wd), NULL));
+ process_events ();
+
tr_watchdir_free (wd);
event_base_free (ev_base);