Fixed resource leaks.
This commit is contained in:
parent
7d27062edd
commit
1d2adcbe26
@ -286,6 +286,7 @@ static void parallel_free(DEVICE* device)
|
|||||||
MessageQueue_PostQuit(parallel->queue, 0);
|
MessageQueue_PostQuit(parallel->queue, 0);
|
||||||
WaitForSingleObject(parallel->thread, INFINITE);
|
WaitForSingleObject(parallel->thread, INFINITE);
|
||||||
|
|
||||||
|
Stream_Free(parallel->device.data, TRUE);
|
||||||
MessageQueue_Free(parallel->queue);
|
MessageQueue_Free(parallel->queue);
|
||||||
CloseHandle(parallel->thread);
|
CloseHandle(parallel->thread);
|
||||||
|
|
||||||
|
@ -365,10 +365,16 @@ static void serial_free(DEVICE* device)
|
|||||||
|
|
||||||
DEBUG_SVC("freeing device");
|
DEBUG_SVC("freeing device");
|
||||||
|
|
||||||
|
/* Stop thread */
|
||||||
SetEvent(serial->stopEvent);
|
SetEvent(serial->stopEvent);
|
||||||
|
WaitForSingleObject(serial->thread, INFINITE);
|
||||||
|
|
||||||
/* TODO: free lists */
|
/* 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);
|
free(serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user