[Qt-interest] seg faults in QApplication destructor?

Sonic syamcr at gmail.com
Thu Jan 8 02:32:07 CET 2009


Alan Ezust wrote:
> If for example, you added a heap QObject to a pointer collection, but
> it also has a parent which is indirectly or directly a child of one of
> your QWidgets, or the QApplication. Then before exit, you iterate
> through the collection, deleting all the heap objects in it, but they
> are still in the childlist of another QObject. 
>   
Will that happen? When I delete a QWdiget/QObject using the delete 
operator, isn't it automatically removed from it's parent's list of 
children?


> On Wed, Jan 7, 2009 at 3:33 PM, John Dailey <john.w.dailey at gmail.com> wrote:
>   
>> I am working on a QT4.3.4 project that I inherited and it is behaving
>> in a manner that seems strange to me.  It consistently seg faults in
>> the QApplication destructor (according to GDB anyway).  The back trace
>> generated when it does seg fault is not consistant, but it seems to go
>> through QHash and free on it's ultimate path to oblivion.  I am a
>> novice when it comes to QT and to gui programming in general so I fear
>> I may be missing something obvious.
>>     
Are you using command line arguments (in main() and passed on to 
QApplication?

Syam



More information about the Qt-interest-old mailing list