Merge pull request #2817 from FreeRDP/mh-fix-collection-free
fixed misc *_free functions to accept NULL
This commit is contained in:
commit
b13676049c
@ -470,6 +470,9 @@ out_free:
|
||||
|
||||
void ArrayList_Free(wArrayList *arrayList)
|
||||
{
|
||||
if (!arrayList)
|
||||
return;
|
||||
|
||||
ArrayList_Clear(arrayList);
|
||||
DeleteCriticalSection(&arrayList->lock);
|
||||
free(arrayList->array);
|
||||
|
@ -348,5 +348,8 @@ wBitStream* BitStream_New()
|
||||
|
||||
void BitStream_Free(wBitStream* bs)
|
||||
{
|
||||
if (!bs)
|
||||
return;
|
||||
|
||||
free(bs);
|
||||
}
|
||||
|
@ -182,6 +182,9 @@ fail_critical_section:
|
||||
|
||||
void CountdownEvent_Free(wCountdownEvent* countdown)
|
||||
{
|
||||
if (!countdown)
|
||||
return;
|
||||
|
||||
DeleteCriticalSection(&countdown->lock);
|
||||
CloseHandle(countdown->event);
|
||||
|
||||
|
@ -128,6 +128,9 @@ wDictionary* Dictionary_New(BOOL synchronized)
|
||||
|
||||
void Dictionary_Free(wDictionary* dictionary)
|
||||
{
|
||||
if (!dictionary)
|
||||
return;
|
||||
|
||||
free(dictionary);
|
||||
}
|
||||
|
||||
|
@ -46,5 +46,8 @@ wKeyValuePair* KeyValuePair_New(void* key, void* value)
|
||||
|
||||
void KeyValuePair_Free(wKeyValuePair* keyValuePair)
|
||||
{
|
||||
if (!keyValuePair)
|
||||
return;
|
||||
|
||||
free(keyValuePair);
|
||||
}
|
||||
|
@ -223,6 +223,9 @@ error_array:
|
||||
|
||||
void MessageQueue_Free(wMessageQueue* queue)
|
||||
{
|
||||
if (!queue)
|
||||
return;
|
||||
|
||||
CloseHandle(queue->event);
|
||||
DeleteCriticalSection(&queue->lock);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user