Merge pull request #2817 from FreeRDP/mh-fix-collection-free

fixed misc *_free functions to accept NULL
This commit is contained in:
Martin Fleisz 2015-07-31 08:19:03 +02:00
commit b13676049c
6 changed files with 18 additions and 0 deletions

View File

@ -470,6 +470,9 @@ out_free:
void ArrayList_Free(wArrayList *arrayList)
{
if (!arrayList)
return;
ArrayList_Clear(arrayList);
DeleteCriticalSection(&arrayList->lock);
free(arrayList->array);

View File

@ -348,5 +348,8 @@ wBitStream* BitStream_New()
void BitStream_Free(wBitStream* bs)
{
if (!bs)
return;
free(bs);
}

View File

@ -182,6 +182,9 @@ fail_critical_section:
void CountdownEvent_Free(wCountdownEvent* countdown)
{
if (!countdown)
return;
DeleteCriticalSection(&countdown->lock);
CloseHandle(countdown->event);

View File

@ -128,6 +128,9 @@ wDictionary* Dictionary_New(BOOL synchronized)
void Dictionary_Free(wDictionary* dictionary)
{
if (!dictionary)
return;
free(dictionary);
}

View File

@ -46,5 +46,8 @@ wKeyValuePair* KeyValuePair_New(void* key, void* value)
void KeyValuePair_Free(wKeyValuePair* keyValuePair)
{
if (!keyValuePair)
return;
free(keyValuePair);
}

View File

@ -223,6 +223,9 @@ error_array:
void MessageQueue_Free(wMessageQueue* queue)
{
if (!queue)
return;
CloseHandle(queue->event);
DeleteCriticalSection(&queue->lock);