Results 1 to 10 of 10

Thread: Terminating QThread error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Nov 2007
    Posts
    53
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Terminating QThread error

    Quote Originally Posted by wysota View Post
    I don't really understand what you mean.


    What is the exact code you used?
    I tried to reproduce it on the mandelbrot sample and I had no problems. Then, I've thought immediately where I could have done a mistake previously (even if I didn't keep the tried code) !!!

    MyThread *thread = new MyThread();

    in the constructor of my class !!! I instanciate a local object to my constructor rather than using the member :

    thread = new MyThread();

    I was quite tired, sorry !

    Can't gSOAP make asynchronous calls? Anyway gSOAP call hangs on some system call like read and you can send a signal to cause it to return immediately with EINTR. Then you'll be able to shut down the thread.
    I haven't seen such a thing in the documentation. You can use asynchronous call only for one way messages so if you don't need an answer.

    You can only deal with time-out but this is not a solution I want for the reactivity of my app.

    Moreover, the documentation say :

    ---
    Caution: Many Linux versions do not support non-blocking connect(). Therefore, setting soap.connect_timeout for non-blocking soap_call_ns__method calls may not work under Linux.
    ---

    Still, using terminate is dangerous. Of course if your application doesn't do anything serious, consequences will also be minimal.
    I will listen to you even if it works now and if I think there could not conducts to problems (but the application does something serious because it deals with customers data).

    Now that I have found my mistake regarding on the heap QThread allocation, I could manage myself when the thread should be destroyed.

    So if the QThread's theorical parent (I won't give this to the QThread constructor to avoid cascading deletion process of Qt) is to be destroyed, I could now launch a monitoring code in the QApplication object, from the QThread's parent destructor that will destroyed the thread after it has properly terminate his job.

    Thanks for your answers and to tell me that it is still very bad to deal with evil ;o)
    Last edited by nooky59; 22nd August 2008 at 13:23.

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19

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.