Commit fbf3a8f5 authored by Andy Shaw's avatar Andy Shaw
Browse files

Close the handle for the events that were created


The handles should be closed when QSerialPort is deleted in order to clean
up the native resources.

Change-Id: If04521fc0fa3b898093bda3317962b4c44818034
Reviewed-by: default avatarDenis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: default avatarSergey Belyashov <Sergey.Belyashov@gmail.com>
Showing with 11 additions and 0 deletions
......@@ -127,6 +127,16 @@ QSerialPortPrivate::QSerialPortPrivate(QSerialPort *q)
}
}
QSerialPortPrivate::~QSerialPortPrivate()
{
if (communicationOverlapped.hEvent)
CloseHandle(communicationOverlapped.hEvent);
if (readCompletionOverlapped.hEvent)
CloseHandle(readCompletionOverlapped.hEvent);
if (writeCompletionOverlapped.hEvent)
CloseHandle(writeCompletionOverlapped.hEvent);
}
bool QSerialPortPrivate::open(QIODevice::OpenMode mode)
{
Q_Q(QSerialPort);
......
......@@ -63,6 +63,7 @@ class QSerialPortPrivate : public QSerialPortPrivateData
public:
QSerialPortPrivate(QSerialPort *q);
~QSerialPortPrivate();
bool open(QIODevice::OpenMode mode);
void close();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment