bluetiger9 / SmtpClient-for-Qt

An SMTP Client writen in C++ for Qt. Allows applications to send emails (MIME with text, html, attachments, inline files, etc.) via SMTP. Supports SSL and SMTP authentication.
https://github.com/bluetiger9/SmtpClient-for-Qt/wiki
GNU Lesser General Public License v2.1
449 stars 226 forks source link

QTimer object destroyed before use #126

Closed ChaseyLain closed 1 year ago

ChaseyLain commented 1 year ago

Hello my friend! Great work! Thank you!

I found that in 2.0 Version Branch smtpclient.cpp:565 (routine SmtpClient::waitForEvent) the QTimer object is declared.

Because it is in the if() bracket the object is destroyed before loop.run() is executed. Therefore the timeout is never reached. The Timer has no effect.

I would advise moving the declaration of the QTimer object outside of the if() statement.

I would do the change myself, but I'm not familiar at all with how this works on github. Please excuse me using this way.

Thank you for your time!

ChaseyLain commented 1 year ago

I found this to be a duplicate of another issue. I will comment on the other one. Closing this one now, sorry.