summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorArmin Novak <anovak@thinstuff.com>2013-08-13 16:04:19 +0200
committerBernhard Miklautz <bmiklautz@thinstuff.at>2013-08-26 20:10:42 +0200
commit86c0c0297519375edcc4d9c8106fed08dc58987c (patch)
treefe70bbb405cbcd97fe127df5c70eb91a1c8b4f70 /channels
parentac63b9ae566b9b5d2ebc60adf876ebde0b110318 (diff)
downloadfreerdp-86c0c0297519375edcc4d9c8106fed08dc58987c.tar.gz
freerdp-86c0c0297519375edcc4d9c8106fed08dc58987c.tar.bz2
freerdp-86c0c0297519375edcc4d9c8106fed08dc58987c.zip
Fixed resource leaks.
Diffstat (limited to 'channels')
-rw-r--r--channels/parallel/client/parallel_main.c1
-rw-r--r--channels/serial/client/serial_main.c12
2 files changed, 10 insertions, 3 deletions
diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c
index 6e35c1ee9..16bf4bbb0 100644
--- a/channels/parallel/client/parallel_main.c
+++ b/channels/parallel/client/parallel_main.c
@@ -286,6 +286,7 @@ static void parallel_free(DEVICE* device)
MessageQueue_PostQuit(parallel->queue, 0);
WaitForSingleObject(parallel->thread, INFINITE);
+ Stream_Free(parallel->device.data, TRUE);
MessageQueue_Free(parallel->queue);
CloseHandle(parallel->thread);
diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c
index 80be6c88f..cb0852a5a 100644
--- a/channels/serial/client/serial_main.c
+++ b/channels/serial/client/serial_main.c
@@ -365,10 +365,16 @@ static void serial_free(DEVICE* device)
DEBUG_SVC("freeing device");
+ /* Stop thread */
SetEvent(serial->stopEvent);
-
- /* TODO: free lists */
-
+ WaitForSingleObject(serial->thread, INFINITE);
+
+ /* Clean up resources */
+ Stream_Free(serial->device.data, TRUE);
+ Queue_Free(serial->queue);
+ list_free(serial->pending_irps);
+ CloseHandle(serial->stopEvent);
+ CloseHandle(serial->thread);
free(serial);
}