title: Qt: How to clean up a QThread when you do not subclass it?
body: <p>If I have the most standard code of using a QThread like this:</p>
  
  <pre><code>myClass* object = new myClass();
  QThread* worker = new QThread();
  object-&gt;moveToThread(worker);
  worker-&gt;start();
  </code></pre>
  
  <p>Then what is the proper way to delete <em>object</em> and the proper way to quit the <em>worker</em> thread?</p>
  
  <p>If I don't delete <em>object</em> there will be memory leakage.</p>
  
  <p>If I don't quit <em>worker</em>, when I close the application, there will be warning said that QThread is destroyed while it is still running.</p>