/** * raptor_free_iostream: * @iostr: iostream object * * Destructor - destroy an iostream. **/ void raptor_free_iostream(raptor_iostream *iostr) { RAPTOR_ASSERT_OBJECT_POINTER_RETURN(iostr, raptor_iostream); if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) raptor_iostream_write_end(iostr); if(iostr->handler->finish) iostr->handler->finish(iostr->user_data); if((iostr->flags & RAPTOR_IOSTREAM_FLAGS_FREE_HANDLER)) RAPTOR_FREE(raptor_iostream_handler2, iostr->handler); RAPTOR_FREE(raptor_iostream, iostr); }
/** * raptor_free_iostream: * @iostr: iostream object * * Destructor - destroy an iostream. **/ void raptor_free_iostream(raptor_iostream *iostr) { if(!iostr) return; if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) raptor_iostream_write_end(iostr); if(iostr->handler->finish) iostr->handler->finish(iostr->user_data); if((iostr->flags & RAPTOR_IOSTREAM_FLAGS_FREE_HANDLER)) RAPTOR_FREE(raptor_iostream_handler, iostr->handler); RAPTOR_FREE(raptor_iostream, iostr); }