Hi,
We have a strange problem. We are invoking the FolderBrowseDialog and
have found that if we cancel that dialog within a few seconds of it
appearing it causes one of our (completely unrelated) background
threads to hang on program shut down.
Details:
Background thread is sitting idle waiting for work. This thread has
nothing to with the folder selection activity - it's a completely
separate part of the application.
In unrelated code the user causes the FolderBrowseDialog to appear then
quickly cancels it.
On program exit the background thread is terminated successfully but
the code waiting for it to terminate:
while(workerThread.IsAlive)
Thread.Sleep(100);
Never terminates.
We have put breakpoints in the worker thread that show that it detects
our stop flag and exits correctly.
It looks to us like the FolderBrowseDialog is causing the .NET thread
manager to block and it never gets around to setting IsAlive to false.
FWIW:This problem is most prevalent on machines with one or more slow
drive mappings. If users select [OK] it isn't an issue. If users wait
half a minute before selecting [Cancel] it isn't normally a problem
either. It seems to relate to the dialog box populate itself in a
background thread.
--