|
-
April 7th, 2012, 09:29 AM
#2
Re: Problem with recursive file search
First of all, if you want to wait for a thread to finish, use the Thread.Join method, instead of sleeping and waking up when it ends.
Also, if you are waiting for the thread to finish, it will block your UI. The user will not expect for the UI to be blocked until the search, which might take a lot of time, finished. Consider using a BackgroundWorker to fix this issue.
As to your original concern, you'll have to solve it yourself, or at least provide us with more relevant information.
It's possible that the search process does end, but just takes a lot of time. It is also possible that it's getting hanged somewhere.
In order to find out exactly what happens, write logs to the output window (using the Debug.WriteLine method), place breakpoints, and use the Debug->Break to find out where the code is at a given time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|