AnsweredAssumed Answered

SetViewpointAsync causing random AccessViolationException

Question asked by cmatherne on Jan 24, 2017
Latest reply on Oct 10, 2017 by cleppanen



I'm running into the following randomly: System.AccessViolationException was unhandled Message: An unhandled exception of type 'System.AccessViolationException' occurred in WindowsBase.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.    


A little background:

- I'm running Runtime v100.0

- The app is written using MVVM and Prism IoC

- There's a View (TwoDView) which has a MapView

- TwoDView has a ViewModel (TwoDViewModel) which navigates -- uses RequestNavigate(...) -- to a view (ThreeDView) which has SceneView

- ThreeDViewModel responds to the navigation and applies the camera (calling a controller, created to manage the SceneView using a WeakReference<>) passed via navigation parameters

- The controller calls SetViewpointCameraAsync  


There is also a back button in ThreeDView to allow going back to TwoDView for selecting another 3D area for inspection.  It seems multiple calls to SetViewpointCameraAsync is causing my issue...if I use issue (it seems).  Any ideas??