title: Visual Studio project remains "stuck" when stopped
body: <p>Currently developing a connector DLL to HP's Quality Center. I'm using their (insert expelative) COM API to connect to the server. An Interop wrapper gets created automatically by VStudio.  </p>
  
  <p>My solution has 2 projects: the DLL and a tester application - essentially a form with buttons that call functions in the DLL. Everything works well - I can create defects, update them and delete them. When I close the main form, the application stops nicely.</p>
  
  <p>But when I call a function that returns a list of all available projects (to fill a combo box), if I close the main form, VStudio still shows the solution as running and I have to stop it.</p>
  
  <p>I've managed to pinpoint a single function in my code that when I call, the solution remains "hung" and if I don't, it closes well. It's a call to a property in the TDC object <code>get_VisibleProjects</code> that returns a <code>List</code> (not the .Net one, but a type in the COM library) - I just iterate over it and return a proper list (that I later use to fill the combo box):</p>
  
  <pre><code>    public List&lt;string&gt; GetAvailableProjects()
      {
          List&lt;string&gt; projects = new List&lt;string&gt;();
          foreach (string project in this.tdc.get_VisibleProjects(qcDomain))
          {
              projects.Add(project);
          }
          return projects;
      }
  </code></pre>
  
  <p>My assumption is that something gets retained in memory. If I run the EXE outside of VStudio it closes - but who knows what gets left behind in memory?</p>
  
  <p>My question is - how do I get rid of whatever calling this property returns? Shouldn't the GC handle this? Do I need to delve into pointers?</p>
  
  <p><strong>Things I've tried:</strong></p>
  
  <ol>
  <li>getting the list into a variable and setting it to null at the end of the function</li>
  <li>Adding a destructor to the class and nulling the <code>tdc</code> object</li>
  <li>Stepping through the tester function application all the way out, whne the form closes and the Main function ends - it closes, but VStudio still shows I'm running.</li>
  </ol>
  
  <p>Thanks for your assistance!</p>