SerialBusConnection: Use member initialization
And as we have full C++11 support, so its also preferred to use nullptr.
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
SerialBusConnection::SerialBusConnection(QString portName) :
|
SerialBusConnection::SerialBusConnection(QString portName) :
|
||||||
CANConnection(portName, CANCon::SOCKETCAN, 1, 4000, true),
|
CANConnection(portName, CANCon::SOCKETCAN, 1, 4000, true),
|
||||||
mDev_p(NULL),
|
|
||||||
mTimer(this) /*NB: set connection as parent of timer to manage it from working thread */
|
mTimer(this) /*NB: set connection as parent of timer to manage it from working thread */
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -135,7 +134,7 @@ void SerialBusConnection::disconnectDevice() {
|
|||||||
if(mDev_p) {
|
if(mDev_p) {
|
||||||
mDev_p->disconnectDevice();
|
mDev_p->disconnectDevice();
|
||||||
delete mDev_p;
|
delete mDev_p;
|
||||||
mDev_p = Q_NULLPTR;
|
mDev_p = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ private slots:
|
|||||||
void testConnection();
|
void testConnection();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QCanBusDevice* mDev_p;
|
QCanBusDevice *mDev_p = nullptr;
|
||||||
QTimer mTimer;
|
QTimer mTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user