static void _destroyIndexes(_MetisLRUContentStore *store) { if (store->indexByNameHash != NULL) { parcHashCodeTable_Destroy(&(store->indexByNameHash)); } if (store->indexByNameAndKeyIdHash != NULL) { parcHashCodeTable_Destroy(&(store->indexByNameAndKeyIdHash)); } if (store->indexByRecommendedCacheTime != NULL) { metisTimeOrderedList_Release(&(store->indexByRecommendedCacheTime)); } if (store->indexByExpirationTime != NULL) { metisTimeOrderedList_Release(&(store->indexByExpirationTime)); } // This tables must go last. It holds the references to the MetisMessage. if (store->storageByNameAndObjectHashHash != NULL) { parcHashCodeTable_Destroy(&(store->storageByNameAndObjectHashHash)); } if (store->lru != NULL) { metisLruList_Destroy(&(store->lru)); } }
static void _UDPLinkData_Destroy(_UDPLinkData **linkData) { // remove any queued messages if ((*linkData)->queue) { while (parcDeque_Size((*linkData)->queue) > 0) { CCNxMetaMessage *ccnxMetaMessage = parcDeque_RemoveFirst((*linkData)->queue); ccnxMetaMessage_Release(&ccnxMetaMessage); } parcDeque_Release(&((*linkData)->queue)); } if ((*linkData)->multiplexTable) { parcHashCodeTable_Destroy(&((*linkData)->multiplexTable)); } parcMemory_Deallocate(linkData); }