Eliminate the crash on Unix caused by the QLockFile usage
authorLaszlo Papp <lpapp@kde.org>
Thu, 7 Nov 2013 14:04:39 +0000 (14:04 +0000)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 7 Nov 2013 14:36:30 +0000 (15:36 +0100)
commit1eddbe335fc6d2ad4d1dca3a28d51d24b045bbf7
treec052777ecc5a0e121d678b60798e531429ac1be0
parente2e796301ab87aeedc1ab7952de8ae64df851646
Eliminate the crash on Unix caused by the QLockFile usage

We should not check against null because swap should always take place.
Initially, we do not construct a valid pointer guarded by the QScopedPointer
because not every constructor takes the portname argument, so it is possible to
create a QSerialPort instance without portname, and set it later.

Hence, removing the check makes sense, otherwise the smart pointer will guard a
null raw pointer which will cause crash all of a sudden when trying to be used.

Change-Id: Ib383f6eef2761ca5822585b848b0d29cce4eeb45
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
src/serialport/qserialport_unix.cpp