If this thread can go away by itself, that is great.
One reason I think it should be explicitely terminated is that I got the
following message which I have never had before creating this thread:
COM object that has been separated from its underlying RCW cannot be used"
exception within threads
"Jon Skeet [C# MVP]" wrote:
> Andrew <(E-Mail Removed)> wrote:
> > In my app, after a user selects a document, I create a new thread to print
> > this document so that this user may continue to do his/her work.
> >
> > Thread thread = new Thread(new
> > ThreadStart(bulkPrint.bulkPrint));
> > thread.SetApartmentState(ApartmentState.STA);
> > thread.IsBackground = true;
> > thread.Start();
> >
> > I currently leave this thread like this without explicitly terminate it.
> >
> > I don't feel right since I think it should be terminated somehow.
> >
> > What should I do and how? Thanks a lot!
>
> Why do you feel you need to terminate it? If it finishes on its own, it
> will go away. If there are only background threads left in the process,
> the process will die.
>
> Why do you want to kill it?
>
> --
> Jon Skeet - <(E-Mail Removed)>
> Web site: http://www.pobox.com/~skeet
> Blog: http://www.msmvps.com/jon_skeet
> C# in Depth: http://csharpindepth.com
>