ev_default_destroy

Malek Hadj-Ali malek at lcde.net
Thu Mar 5 08:33:13 CET 2009



Hi all,


Is it valid to call ev_default_destroy more than once (on 'different'
default loop)?
Example code below fails on the second call to ev_default_destroy with
the following error:

*** glibc detected *** ./test: double free or corruption (fasttop)


Example:
/* configure has been called in libev folder */
/* compile with: gcc -o test -lm test.c (on linux)*/

#include "libev/ev.c"

int main()
{
    struct ev_loop *l0, *l1;

    l0 = ev_default_loop(EVFLAG_AUTO);
    ev_default_destroy();

    l1 = ev_default_loop(EVFLAG_AUTO);
    ev_default_destroy();

    return 0;
}


thanks for any help

malek





More information about the libev mailing list