Results 1 to 10 of 10

Thread: crash in emit()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default crash in emit()

    For some reason when I try to emit a QString I get a segfault.

    Qt Code:
    1. void UDPClient::logEvent( const QString & event, int at_debug ) {
    2. QString event2 = event;
    3. stopper.lock();
    4. emit debugEvent( event2 ); // <--- Segfaults right here
    5. stopper.unlock();
    6. }
    To copy to clipboard, switch view to plain text mode 

    When I went digging through the backtrace I found it was trying to call all the connected slots using a Qt::AutoConnection.

    Qt Code:
    1. if ((c->connectionType == Qt::AutoConnection
    To copy to clipboard, switch view to plain text mode 

    (According to the qtcreator debugger, c->connectionType was 0 which is the same as Qt::AutoConnection).

    The strange part is the only connection I make to this signal I emit is to another signal in the QThread that owns this object. And it never reaches any slots.

    Anyway, I can just comment it out for now, but I'd like to know what mistake I'm making.
    Last edited by mhoover; 25th August 2009 at 02:57. Reason: forgot a critical line of code

Similar Threads

  1. Crash: Heap corruption due to selectedRows()
    By Ankitha Varsha in forum Qt Programming
    Replies: 16
    Last Post: 1st October 2010, 00:55
  2. QString comparison gives wierd crash
    By supergillis in forum Qt Programming
    Replies: 0
    Last Post: 1st June 2009, 22:09
  3. emit qt signal is very slow how it can be optimized?
    By sawerset in forum Qt Programming
    Replies: 8
    Last Post: 30th December 2008, 09:21
  4. how to know which button emit the signal?
    By coder1985 in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2008, 14:26
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.