Results 1 to 11 of 11

Thread: QHash::unite() question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Posts
    79
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: QHash::unite() question

    It had crashed, because it crashes right after the start and there was a seg fault (I hadn't copied the whole text, maybe a mistake..).

    Here is the full (well, i cut the gdb infos) gdb output.
    (gdb) run
    Starting program: /home/damdam/Documents/projekte/cpp/qt/Table2ASCII/build/table2ascii
    [Thread debugging using libthread_db enabled]
    [New Thread -1221245264 (LWP 13707)]
    Qt: gdb: -nograb added to command-line options.
    Use the -dograb option to enforce grabbing.
    i3
    i4

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread -1221245264 (LWP 13707)]
    0x0804fbbb in QHash<My::TabM::ItemPosition, QVariant>::setSharable (this=0x80a9aa8, sharable=true) at /usr/include/QtCore/qhash.h:229
    229 inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
    (gdb) bt
    #0 0x0804fbbb in QHash<My::TabM::ItemPosition, QVariant>::setSharable (this=0x80a9aa8, sharable=true) at /usr/include/QtCore/qhash.h:229
    #1 0x0804fbe7 in ~QMutableHashIterator (this=0xbfd3609c) at /usr/include/QtCore/qhash.h:802
    #2 0x0804ee0f in My::TableModel::insertFields (this=0x809ae08, p_field=0, p_count=1, p_orientation=Qt::Horizontal, p_parent=@0xbfd36154) at my_tablemodel.cpp:137
    #3 0x0804eeb6 in My::TableModel::insertColumns (this=0x809ae08, p_column=0, p_count=1, p_parent=@0xbfd36154) at my_tablemodel.cpp:63
    #4 0x0804bd61 in T2A::MainWindow::addColumn (this=0xbfd361e8) at MainWindow.cpp:47
    #5 0x0804c822 in MainWindow (this=0xbfd361e8) at MainWindow.cpp:27
    #6 0x0804bc87 in main (argc=Cannot access memory at address 0x0) at main.cpp:9
    This is the first time i use gdb from the command line, so please apologise if I've forgotten something..

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: QHash::unite() question

    Quote Originally Posted by aMan View Post
    #0 0x0804fbbb in QHash<My::TabM::ItemPosition, QVariant>::setSharable (this=0x80a9aa8, sharable=true) at /usr/include/QtCore/qhash.h:229
    #1 0x0804fbe7 in ~QMutableHashIterator (this=0xbfd3609c) at /usr/include/QtCore/qhash.h:802
    It looks like you delete m_tableItems while QMutableHashIterator still uses it. Add curly braces around lines 8--17 to force the destruction of l_iterator.

  3. The following user says thank you to jacek for this useful post:

    aMan (5th November 2006)

  4. #3
    Join Date
    Jul 2006
    Posts
    79
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: QHash::unite() question

    Cool, thanks..
    It works now..

Similar Threads

  1. QTextEdit simple question
    By Marcopolo in forum Qt Tools
    Replies: 4
    Last Post: 11th October 2007, 00:01
  2. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38
  3. simple thread layout question
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 12th August 2006, 11:02
  4. simple question on Class-Members
    By mickey in forum General Programming
    Replies: 7
    Last Post: 4th February 2006, 22:37
  5. xml with binary question
    By TheKedge in forum Qt Programming
    Replies: 7
    Last Post: 12th January 2006, 23:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.