Results 1 to 5 of 5

Thread: Loop inside Qthread causes "QThread: Destroyed while thread is still running"?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Loop inside Qthread causes "QThread: Destroyed while thread is still running"?

    Quote Originally Posted by jpn View Post
    "MyThread t" goes out of scope and gets destructed according to normal C++ rules immediately in the end of MainWindowImpl::on_button_clicked(). You might want to allocate it on the heap instead.
    Thanks, it worked.

    If anybody wants to now exactly how i did it: i've replaced:
    Qt Code:
    1. MyThread t;
    2. t.start();
    To copy to clipboard, switch view to plain text mode 
    with
    Qt Code:
    1. MyThread *t=new MyThread;
    2. t->start();
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 26th June 2008 at 19:03. Reason: disabled smilies

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. QThread: Destroyed while thread is still running
    By Shuchi Agrawal in forum Newbie
    Replies: 8
    Last Post: 3rd April 2007, 06:27
  3. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55

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.