]> granicus.if.org Git - libevent/commitdiff
Add a test with an active_later event at event_base_free time.
authorNick Mathewson <nickm@torproject.org>
Wed, 10 Apr 2013 22:03:16 +0000 (18:03 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 10 Apr 2013 22:03:16 +0000 (18:03 -0400)
test/regress.c

index 86b3d197ca34a2cdc74d18ad9c64ed317812de48..bfd2e78bc44ab42d17f8c5b754dce0fb3922084c 100644 (file)
@@ -1406,6 +1406,13 @@ test_active_later(void *ptr)
        tt_int_op(n_write_a_byte_cb, >, 100);
        tt_int_op(n_read_and_drain_cb, >, 100);
        tt_int_op(n_activate_other_event_cb, >, 100);
+
+       /* Now leave this one around, so that event_free sees it and removes
+        * it. */
+       event_active_later_(&ev3, EV_READ);
+       event_base_assert_ok_(data->base);
+       event_base_free(data->base);
+       data->base = NULL;
 end:
        ;
 }