--- libaitio/src/aitio.c 2012/08/02 00:47:47 1.12 +++ libaitio/src/aitio.c 2012/11/15 23:18:33 1.12.6.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.c,v 1.12 2012/08/02 00:47:47 misho Exp $ +* $Id: aitio.c,v 1.12.6.1 2012/11/15 23:18:33 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -105,15 +105,15 @@ io_mm_inuse() // init libaitio routine -void -_init() +__attribute__((constructor)) void +_io_init() { ioLibInit(IO_MPOOL, 0); } // fini libaitio routine -void -_fini() +__attribute__((destructor)) void +_io_fini() { ioLibFini(); } @@ -168,14 +168,14 @@ ioLibFini() { switch (use_mm) { case IO_MPOOL: - mpool_destroy(&io_mpool); - io_malloc = malloc; io_calloc = calloc; io_realloc = realloc; io_strdup = strdup; io_free = free; use_mm = IO_SYSM; + + mpool_destroy(&io_mpool); break; } }