void ILibWebServer_Destroy(void *object) { struct ILibWebServer_StateModule *s = (struct ILibWebServer_StateModule*)object; void *en; void *data; char *key; int keyLength; if(s->VirtualDirectoryTable!=NULL) { en = ILibHashTree_GetEnumerator(s->VirtualDirectoryTable); while(ILibHashTree_MoveNext(en)==0) { ILibHashTree_GetValue(en,&key,&keyLength,&data); free(data); } ILibHashTree_DestroyEnumerator(en); ILibDestroyHashTree(s->VirtualDirectoryTable); } }
void DLNAProtocolInfo_Destruct(struct DLNAProtocolInfo *protocolInfo) { int i; void *en; void *data; char *key; int keyLength; if(protocolInfo->SupportedPlaySpeedsLength>0) { for(i=0;i<protocolInfo->SupportedPlaySpeedsLength;++i) { if(protocolInfo->SupportedPlaySpeeds[i] != NULL) { free(protocolInfo->SupportedPlaySpeeds[i]); } } free(protocolInfo->SupportedPlaySpeeds); } if(protocolInfo->MimeType!=NULL) { free(protocolInfo->MimeType); } if(protocolInfo->Profile!=NULL) { free(protocolInfo->Profile); } if(protocolInfo->NameValueTable!=NULL) { en = ILibHashTree_GetEnumerator(protocolInfo->NameValueTable); while(ILibHashTree_MoveNext(en)==0) { ILibHashTree_GetValue(en,&key,&keyLength,&data); free(data); } ILibDestroyHashTree(protocolInfo->NameValueTable); } free(protocolInfo); }