void QextWinEventNotifier::setEnabled(bool enable)
{
Q_D(QextWinEventNotifier);
if (d->enabled == enable)
return;
d->enabled = enable;
//RFOG PATCH: at this level if dtor chain call with serial port open, notifierThread has been deleted by QT
if(notifierThread()==0)
return;
if (d->enabled)
notifierThread()->registerEventNotifier(this);
else
notifierThread()->unregisterEventNotifier(this);
}
Of course, code works fin if user calls to close() before destructors chains get launched. BTW, I've solved my code avoiding call close() in my own destructors but I've maintained that code in setEnabled() method in my code.