hi all,
i have problem on windows and linux too...
i have 2 threads consumer and producer.
but when i stop them or exit the application i get the following comments after execution:
Running...
QThread: Destroyed while thread is still running

QThread: Destroyed while thread is still running

QWaitCondition: Destroyed while threads are still waiting

---------------------- Exited normally ----------------------


this problem has already been discussed on the following thread but i cudnt find the solution of my prob acc to the solution given in this :
http://www.qtcentre.org/forum/f-qt-p...eads-5969.html

Some code as :
Qt Code:
  1. Consumer.cpp
  2. void Consumer::run()
  3. {
  4. j=0;
  5. while(!flag_stop)
  6. {
  7. usedBytes.acquire();
  8. write_str += buffer[j % 8096];
  9. j++;
  10. freeBytes.release();
  11. emit disp(); // disp a slot of mainwindow.cpp
  12. }
  13. flag_stop = true;
  14. }
  15. Producer.cpp
  16. void Producer::run()
  17. {
  18. i=0;
  19. while(!flag_stop)
  20. {
  21. if(flag_read)
  22. {
  23. freeBytes.acquire();
  24. int n = read_str.size();
  25. buffer[i % 8096] = (*((read_str.toUtf8().constData())+(n-1)));
  26. i++;
  27. usedBytes.release();
  28. flag_read = false;
  29. }
  30.  
  31. }
  32. flag_stop = true;
  33. }
  34.  
  35. Mainwindow.cpp
  36. ...
  37. connect(textEdit_1,SIGNAL(textChanged()),this,SLOT(read_send()));
  38. connect(pushButton_14,SIGNAL(clicked()),this,SLOT(Start_Thread()));
  39. connect(pushButton_15,SIGNAL(clicked()),this,SLOT(Stop_Thread()));
  40. consumer = new Consumer();
  41. producer = new Producer();
  42. connect(consumer,SIGNAL(disp()),this,SLOT(receive_write()));
  43. ...
  44. void MainWindowImpl::Start_Thread()
  45. {
  46. producer->start();
  47. consumer->start();
  48. }
  49. void MainWindowImpl::Stop_Thread()
  50. {
  51. flag_stop = true;
  52. }
  53. void MainWindowImpl::read_send()
  54. {
  55. read_str = textEdit_1->toPlainText();
  56. flag_read = true;
  57. }
  58. void MainWindowImpl::receive_write()
  59. {
  60. textEdit_2->setText(write_str);
  61. }
  62. void MainWindowImpl::closeEvent(QCloseEvent *event)
  63. {
  64. flag_stop = true;
  65. event->accept();
  66. }
To copy to clipboard, switch view to plain text mode 
Can any1 please help me that where i am misleading and where i have taken wrong approach.
Thanks All...