void Mapper_free(Mapper *mapper) { Mapper_flush(mapper); // NIY: Probably more cleanup needed free(mapper); }
void AssemblyMapper_flushImpl(AssemblyMapper *am) { Mapper_flush( AssemblyMapper_getMapper(am) ); // IDHash_free may not be correct function type // // IDHash_free( AssemblyMapper_getComponentRegister(am), IDHash_free); // IDHash_free( AssemblyMapper_getAssembledRegister(am), IDHash_free); IDHash_free( AssemblyMapper_getComponentRegister(am), NULL); // Note: HACK here to handle an IDHash within an IDHash - IDHash freeFunc only passes one arg on so need to HACK - will think about how to do this properly, I promise! IDHash_free( AssemblyMapper_getAssembledRegister(am), freeRegisterIDHash); // Create new hashes AssemblyMapper_setAssembledRegister(am, IDHash_new(IDHASH_MEDIUM)); AssemblyMapper_setComponentRegister(am, IDHash_new(IDHASH_MEDIUM)); }