[Qt] Todays commit

zeljko zeljko at holobit.net
Thu Jul 12 08:43:25 CEST 2007


On Thursday 12 July 2007 08:10, Paul Ishenin wrote:
> Hello,  Items specific to the Qt widget set.
>
> I've tried to understand what can cause memory corruption. My first
> assumption was that Qt events can be fired while Widget destroying. So I
> moved all event creation code to TQtWidget.AttachEvents and all event
> destuction code to TQtWidget.DetachEvents.
>
> Before Widget destruction I call DetachEvents to ensure that no events
> will be fired during death process.
>
> Please look at solution. If you dislike it then revert commit. As for
> me, code became more beautiful without repeating of event attaching
> stuff in various units.

This is what gdb says about today's commit:

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x004fb67e in QTreeWidget_hook_destroy () from /usr/lib/libqt4intf.so
#2  0x081a0ed7 in TQTTREEWIDGET__DETACHEVENTS (this=0x4030c088) at 
qtwidgets.pas:4355
#3  0x081a0a22 in TQTTREEVIEW__DESTROY (vmt=0x0, this=0x4030c088) at 
qtwidgets.pas:4223
#4  0x081a0bed in TQTTREEWIDGET__DESTROY (vmt=0x1, this=0x4030c088) at 
qtwidgets.pas:4284
#5  0x0805bcd9 in SYSTEM_TOBJECT_$__FREE ()
#6  0x08192950 in TQTWSCUSTOMLISTVIEW__DESTROYHANDLE (AWINCONTROL=0x400baef8, 
pvmt=0x4008d418) at qtwscomctrls.pp:765
#7  0x0812087f in TWINCONTROL__DESTROYWND (this=0x400baef8) at 
wincontrol.inc:5495
#8  0x080d6eba in TCUSTOMLISTVIEW__DESTROYWND (this=0x400baef8) at 
customlistview.inc:554
#9  0x0811ce18 in TWINCONTROL__DESTROYHANDLE (this=0x400baef8) at 
wincontrol.inc:3418
#10 0x0811ce03 in TWINCONTROL__DESTROYHANDLE (this=0x400b7228) at 
wincontrol.inc:3415
#11 0x08070932 in TCUSTOMFORM__SHOWMODAL (this=0x400b7228) at 
customform.inc:1992
#12 0x08077678 in TFORM1__MENUITEM2CLICK (SENDER=0x4009c208, this=0x400b66e8) 
at unit1.pas:132
#13 0x081a1a86 in TQTMENU__SLOTTRIGGERED (CHECKED=false, this=0x40002668) at 
qtwidgets.pas:4762
#14 0x0050ddd5 in QAction_hook::triggered_hook () from /usr/lib/libqt4intf.so
#15 0x004f5f1d in QAction_hook::qt_metacall () from /usr/lib/libqt4intf.so
#16 0x0038606f in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#17 0x0038631a in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#18 0x067235db in QAction::triggered () from /usr/lib/libQtGui.so.4
#19 0x067238b2 in QAction::activate () from /usr/lib/libQtGui.so.4
#20 0x06a8c3d8 in QMenuPrivate::activateAction () from /usr/lib/libQtGui.so.4
#21 0x06a8ea16 in QMenu::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#22 0x0676bafd in QWidget::event () from /usr/lib/libQtGui.so.4
#23 0x06a89d27 in QMenu::event () from /usr/lib/libQtGui.so.4
#24 0x06728d1b in QApplicationPrivate::notify_helper () 
from /usr/lib/libQtGui.so.4
#25 0x06729a00 in QApplication::notify () from /usr/lib/libQtGui.so.4
#26 0x00376c60 in QCoreApplication::notifyInternal () 
from /usr/lib/libQtCore.so.4
#27 0x06782e31 in QETWidget::translateMouseEvent () 
from /usr/lib/libQtGui.so.4
#28 0x06781a5e in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#29 0x067a38c2 in 
QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate () 
from /usr/lib/libQtGui.so.4
#30 0x02c3418b in g_main_dispatch (context=0x9db92d0) at gmain.c:1934
#31 0x02c35248 in g_main_context_dispatch (context=0x9db92d0) at gmain.c:2484
---Type <return> to continue, or q <return> to quit---
#32 0x02c3557c in g_main_context_iterate (context=0x9db92d0, block=1, 
dispatch=1, self=0x9db8318) at gmain.c:2565
#33 0x02c357dc in g_main_context_iteration (context=0x9db92d0, may_block=0) at 
gmain.c:2624
#34 0x00397aea in QEventDispatcherGlib::processEvents () 
from /usr/lib/libQtCore.so.4
#35 0x067a33df in QGuiEventDispatcherGlib::processEvents () 
from /usr/lib/libQtGui.so.4
#36 0x0037631c in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#37 0x003764b0 in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#38 0x0037a724 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#39 0x0672834d in QApplication::exec () from /usr/lib/libQtGui.so.4
#40 0x004b071c in QApplication_exec () from /usr/lib/libqt4intf.so
#41 0x0818a9c1 in TQTWIDGETSET__APPRUN (ALOOP=0x8074880 
<TAPPLICATION__RUNLOOP>, this=0x40013788) at qtobject.inc:102
#42 0x0807486c in TAPPLICATION__RUN (this=0x400a4028) at application.inc:1033
#43 0x08051db5 in main () at project1.lpr:13



zeljko



More information about the Qt mailing list