Proposal: Avoid "Do not delete object, 'KRun::timer' during its event handler!" warning

David Faure faure at kde.org
Wed Mar 26 16:39:17 GMT 2008


On Wednesday 26 March 2008, Jarosław Staniek wrote:
> We have the following warning because of callin 'delete this' in 
> KRun::slotTimeout():
> 
>   warning: QObject: Do not delete object, 'KRun::timer', during its event
>   handler!
> 
> Is there any reason I shouldn't propose turning KRun::KRunPrivate::m_timer 
> into QTimer* and call deleteLater()?

I'd rather avoid delete this altogether (in a slot!) and turn -that- one into a deleteLater().
Nothing cares about when a KRun is deleted (it emits the finished() signal before that anyway),
so we can delay it.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list