I cannot see an issue with hanging here. What exact code do you use that causes the application to hang?