System.OutOfMemoryException unhandled exception?

a 夏天 提交于 2019-12-12 01:53:12

问题


I'm working on a C# project for windows phone 8 that plays selected youtube videos.My app has 1 page, which has 3 Grids (1 for each of 3 States).

  1. Video Selection Menu (where I have an ItemsControl which has around 80-100 grids inside, where each of those grids has 2 textblocks, 1 image and a button inside them)
  2. Video Details Menu (Shows more info about the video the user selected on the "Video Selection Menu" and has a play button which gets you to the third State).
  3. Video (has a webbrowser control with the selected video)

Ok, about the problem now... When I have selected a video from State_1, then pressed play in State_2 that gets me to State_3 it's all ok. But when I go back to State_1 and start to scroll through the videos I get this exception: An unhandled exception of type 'System.OutOfMemoryException' occurred in System.Windows.ni.dll

Do you have any idea on what is the problem or how to fix this?

NOTE:

  1. Whenever a State changes I make Visibility.Collapsed the 2 other Grids and Visibility.Visible the Grid that the State variable states.
  2. When I don't have a webbrowser in the app (so no State_3) it works fine no problems. So my guess is that I need to disable the memory allocation of webbrowser when I'm not using it but not sure how.

Call Stack:

  1. > MyappName.DLL!MyappName.App.Application_UnhandledException(object sender, System.Windows.ApplicationUnhandledExceptionEventArgs e) Line 107 C# Debugger.Break();
  2. System.Windows.ni.dll!MS.Internal.Error.CallApplicationUEHandler(System.Exception e) Unknown
  3. System.Windows.ni.dll!MS.Internal.JoltHelper.OnUnhandledException(object sender, System.UnhandledExceptionEventArgs args) Unknown
  4. [Native to Managed Transition]
  5. [Managed to Native Transition]
  6. System.Windows.ni.dll!MS.Internal.FrameworkCallbacks.NotifyManagedDebuggerOnNativeOOM() Unknown

来源:https://stackoverflow.com/questions/28199420/system-outofmemoryexception-unhandled-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!