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

Jaroslaw Staniek js at iidea.pl
Wed Mar 26 22:48:40 GMT 2008


David Faure said the following, On 2008-03-26 17:39:
> 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.

Commited that but (still having the breakpoint set at the warning), found out 
another place causing the same warning. Clicking cancel on job tracker's 
progress dialog,
KWidgetJobTracker::Private::ProgressWidget::_k_stop() is called.
This time not sure this is sloveable equally easy, considering the comment 
from ereslibre.


warning---> QtCored4.dll!QObject::~QObject()  Line 887	C++
  	QtGuid4.dll!QWidget::~QWidget()  Line 1311 + 0x41 bytes	C++
  	QtGuid4.dll!QAbstractButton::~QAbstractButton()  Line 602 + 0xf bytes	C++
  	QtGuid4.dll!QPushButton::~QPushButton()  Line 293 + 0x8 bytes	C++
  	kdeui.dll!KPushButton::~KPushButton()  Line 131 + 0x12 bytes	C++
  	kdeui.dll!KPushButton::`vector deleting destructor'()  + 0x54 bytes	C++
  	QtCored4.dll!QObjectPrivate::deleteChildren()  Line 1854 + 0x24 bytes	C++
  	QtGuid4.dll!QWidget::~QWidget()  Line 1300	C++
  	kdeui.dll!KWidgetJobTracker::Private::ProgressWidget::~ProgressWidget() 
Line 84 + 0x44 bytes	C++
  	kdeui.dll!KWidgetJobTracker::Private::ProgressWidget::`scalar deleting 
destructor'()  + 0x16 bytes	C++
 >	kdeui.dll!KWidgetJobTracker::Private::ProgressWidget::_k_stop()  Line 596 + 
0x45 bytes	C++
 
kdeui.dll!KWidgetJobTracker::Private::ProgressWidget::qt_metacall(QMetaObject::Call 
_c=InvokeMetaMethod, int _id=13, void * * _a=0x00dabc00)  Line 103	C++
  	QtCored4.dll!QMetaObject::activate(QObject * sender=0x0895fdc0, int 
from_signal_index=29, int to_signal_index=30, void * * argv=0x00dabc00)  Line 
2995 + 0x2b bytes	C++
  	QtCored4.dll!QMetaObject::activate(QObject * sender=0x0895fdc0, const 
QMetaObject * m=0x65871a1c, int from_local_signal_index=2, int 
to_local_signal_index=3, void * * argv=0x00dabc00)  Line 3085 + 0x15 bytes	C++
  	QtGuid4.dll!QAbstractButton::clicked(bool _t1=false)  Line 185 + 0x17 bytes	C++
  	QtGuid4.dll!QAbstractButtonPrivate::emitClicked()  Line 549	C++
  	QtGuid4.dll!QAbstractButtonPrivate::click()  Line 541	C++
  	QtGuid4.dll!QAbstractButton::mouseReleaseEvent(QMouseEvent * e=0x00dac310) 
  Line 1117	C++



-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)




More information about the kde-core-devel mailing list