title: How do I pass a pointer to a class object between threads and have it persist after the main thread finishes executing?
body: <p>Here's the problem that I'm having:</p>
  
  <p>The main thread creates class objects (mybaseclass* local = new childclass;) which are essentially commands that know what they are suppose to do.  It then passes a pointer to the class object to a forked thread over a socket and then the main thread is done with the object and returns waiting for some other input.  The forked thread then reads the pointer from the queue, but the class object that the pointer was pointing to has already been automatically deleted when the main thread completed.  How do I get the class object to persist once the main thread is done executing?</p>
  
  <p>Thanks!
  Jeff</p>