المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Windows Form Freeze



C# Programming
09-01-2009, 03:13 PM
Hi All,
I have created a custom video player in C#. This player has two forms.
1. The Video Player window ( running in primary (UI) thread )
2. The content playing window (running in a secondary thread)

Everything goes fine for nearly 5-6 hours, then the main video player window freeze.So i cannot access any of the buttons (stop, pause ,exit) in the player.

But the secondary thread keeps playing the files for even two days continuously ( which is the max i tested).

Things i have checked :
1. There is no memory issue, since i dispose the objects i create after playing each file ( few min videos) . I have checked the process in task manager, where status is running and memory usage as same as it is started.

2.I have used BeginInvoke from secondary thread to update the current playing file in the list box on the main video player window ( once the main window freeze, the update is not visible)

3. I have used a timer in the main video player window and tried *******ing form , calling Application
.DoEvent() for every few minutes , still it gets freeze up after 5-6 hours.

Why the UI window freeze up?
Is my architecture for the player is wrong?
(I need to do lots of processing in secondary thread for the images and videos to be played, but it is working fine)

Kindly give me your suggestions.