Hi all,<div><br></div><div>I have an issue concerning thread usage inside paraview. I am using the vrpn library to connect some controllers and manipulate paraview's objects. I am running the connection routine of vrpn on a separate thread (so the main thread of paraview keeps running smooth). However i can't seem to launch the thread correctly... what i am doing is:</div>
<div><br></div><div>In the run method of my class(which i inherit from QThread)</div><div><br></div><div>void</div><div>myThread::run()</div><div>{</div><div> analog = new vrpn_Analog_Remote(name.c_str());</div><div> if(!analog)</div>
<div> {</div><div> cout << "Error opening device";</div><div> return;</div><div> }</div><div> else</div><div> {</div><div> std::cout<<"SUCCESS"<<std::endl;</div><div> analog->register_change_handler ( NULL, vrpnThread::handleAnalog );</div>
<div> while(true)</div><div> {</div><div> analog->mainloop();</div><div> }</div><div> }</div><div>}</div><div><br></div><div>In the paraview GUI i have a button when pressed launches a connection to a vrpn server, as follows:</div>
<div><br></div><div><div>void SourceToolbarActions::connectVRPNServer(void)</div><div>{</div><div> vrpnThread theThread;</div><div> theThread.start();</div><div>}</div></div><div><br></div><div><br></div><div>So, when i click the GUI button a message appears saying the following:</div>
<div><br></div><div> QThread: Destroyed while thread is still running...</div><div><br></div><div>I have put the thread to wait also </div><div><br></div><div> theThread.wait() </div><div><br></div><div>
but if i do this its obviously that Paraview's GUI will get blocked...</div><div><br></div><div><br></div><div>Any ideas how to work around this problem...</div><div><br></div><div><br></div><div>Thanks in advance.</div>
<div><br></div><div><br></div><div><br></div><div>Any idea what i am doing wrong?</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>