WP8.1 (0xc0000005) 'Access violation' crash

705 views Asked by At

I develop a Windows Phone 8.1 program using winRT and have an error which is not caught by VS. The only output line I get is "The program 'MyProgram.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'." I have a HLS streaming and it occurs every time the stream ends. I thought it might be caused by calling Frame.GoBack() in non GUI thread, but I double checked this, and it is not the reason. Did anyone struggle with this kind of error and know what might be the reason or how to fix this.

1

There are 1 answers

0
sid On

I was having the same issue in my application (Universal WP8.1 WinRT). First, I thought it was because I wasn't using Dispatcher when calling Frame.Navigate (see here).

On searching further, & checking my code, I found that calling Frame.GoBack() from within an event was causing the issue. In my case, it was being called when a user toggles some option in settings page.

But, when I call Frame.GoBack() in the hardware back button press event handler, there is no exception. Everything worked fine.

In your case, you can just stop the streaming on stream end event, & let the user press back button to return to previous page. Or, although I haven't tried this, try using a Dispatcher:

await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => Frame.GoBack());

Hope this helps.