{"action":"created","issue":{"url":"https://api.github.com/repos/cefsharp/CefSharp/issues/1108","labels_url":"https://api.github.com/repos/cefsharp/CefSharp/issues/1108/labels{/name}","comments_url":"https://api.github.com/repos/cefsharp/CefSharp/issues/1108/comments","events_url":"https://api.github.com/repos/cefsharp/CefSharp/issues/1108/events","html_url":"https://github.com/cefsharp/CefSharp/issues/1108","id":93182219,"number":1108,"title":"WinForms browser hanging on return from C# code","user":{"login":"TCSolutions","id":5161634,"avatar_url":"https://avatars.githubusercontent.com/u/5161634?v=3","gravatar_id":"","url":"https://api.github.com/users/TCSolutions","html_url":"https://github.com/TCSolutions","followers_url":"https://api.github.com/users/TCSolutions/followers","following_url":"https://api.github.com/users/TCSolutions/following{/other_user}","gists_url":"https://api.github.com/users/TCSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/TCSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TCSolutions/subscriptions","organizations_url":"https://api.github.com/users/TCSolutions/orgs","repos_url":"https://api.github.com/users/TCSolutions/repos","events_url":"https://api.github.com/users/TCSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/TCSolutions/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-06T04:04:44Z","updated_at":"2015-07-06T04:35:27Z","closed_at":"2015-07-06T04:35:27Z","body":"I have a main window which contains an instance of a ChromiumWebBrowser. Upon click of a button, it calls a void() on an object from RegisterJSObject, which then creates a new window.\r\n\r\nThis new window contains another ChromiumWebBrowser instance. Now, if I close this new window without interacting with the web browser, when it returns back to the Javascript code in the main window, it hangs.\r\n\r\nI have tried disposing the ChromiumWebBrowser object in the second window before the form gets disposed, however that makes it hang 100% of the time.\r\n\r\nThe Javascript code is very minimal. It just calls this void and that is the end of it.\r\n\r\nIt is also worth noting that when I manually dispose the object, no exceptions are created. However, when I let the GC take care of it, it produces the following first chance:\r\n\r\n```\r\nA first chance exception of type 'System.IO.PipeException' occurred in System.ServiceModel.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll\r\nA first chance exception of type 'System.IO.PipeException' occurred in System.ServiceModel.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.Internals.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.Internals.dll\r\nA first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll\r\nA first chance exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll\r\n```"},"comment":{"url":"https://api.github.com/repos/cefsharp/CefSharp/issues/comments/118710756","html_url":"https://github.com/cefsharp/CefSharp/issues/1108#issuecomment-118710756","issue_url":"https://api.github.com/repos/cefsharp/CefSharp/issues/1108","id":118710756,"user":{"login":"TCSolutions","id":5161634,"avatar_url":"https://avatars.githubusercontent.com/u/5161634?v=3","gravatar_id":"","url":"https://api.github.com/users/TCSolutions","html_url":"https://github.com/TCSolutions","followers_url":"https://api.github.com/users/TCSolutions/followers","following_url":"https://api.github.com/users/TCSolutions/following{/other_user}","gists_url":"https://api.github.com/users/TCSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/TCSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TCSolutions/subscriptions","organizations_url":"https://api.github.com/users/TCSolutions/orgs","repos_url":"https://api.github.com/users/TCSolutions/repos","events_url":"https://api.github.com/users/TCSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/TCSolutions/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T04:35:27Z","updated_at":"2015-07-06T04:35:27Z","body":"That seems to resolve the issue. I will test this further and if I encounter anymore errors, I will get back to you.\r\n\r\nThanks everyone for your input, it's really appreciated. I'll be sure to follow that issue template next time I need to post one.\r\n\r\nCheers!"}}