Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception when calling InvalidatePlot #4

Open
RistoPa opened this issue Aug 9, 2017 · 5 comments
Open

Unhandled exception when calling InvalidatePlot #4

RistoPa opened this issue Aug 9, 2017 · 5 comments

Comments

@RistoPa
Copy link

RistoPa commented Aug 9, 2017

Hi there,

I updated my current OxyPlot WPF project to use your SharpDX approach. It's crashing to unhandled exception when I call PlotView.InvalidatePlot(true). What could be causing this problem (exception below)? I have Windows 8.1 x64 with .NET 4.5.1.

Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException at SharpDX.Direct2D1.SimplifiedGeometrySinkNative.AddLines_(SharpDX.Mathematics.Interop.RawVector2[], Int32) at SharpDX.Direct2D1.SimplifiedGeometrySinkNative.AddLines(SharpDX.Mathematics.Interop.RawVector2[]) at OxyPlot.SharpDX.CacherRenderContext.DrawLine(System.Collections.Generic.IList1<OxyPlot.ScreenPoint>, OxyPlot.OxyColor, Double, Double[], OxyPlot.LineJoin, Boolean) at OxyPlot.RenderingExtensions.DrawClippedLine(OxyPlot.IRenderContext, OxyPlot.OxyRect, System.Collections.Generic.IList1<OxyPlot.ScreenPoint>, Double, OxyPlot.OxyColor, Double, Double[], OxyPlot.LineJoin, Boolean, System.Collections.Generic.List1<OxyPlot.ScreenPoint>, System.Action1<System.Collections.Generic.IList1<OxyPlot.ScreenPoint>>) at OxyPlot.Series.LineSeries.RenderLine(OxyPlot.IRenderContext, OxyPlot.OxyRect, System.Collections.Generic.IList1<OxyPlot.ScreenPoint>) at OxyPlot.Series.LineSeries.RenderLineAndMarkers(OxyPlot.IRenderContext, OxyPlot.OxyRect, System.Collections.Generic.IList1<OxyPlot.ScreenPoint>) at OxyPlot.Series.LineSeries.RenderPoints(OxyPlot.IRenderContext, OxyPlot.OxyRect, System.Collections.Generic.IList1<OxyPlot.DataPoint>) at OxyPlot.Series.LineSeries.Render(OxyPlot.IRenderContext) at OxyPlot.PlotModel.RenderSeries(OxyPlot.IRenderContext) at OxyPlot.PlotModel.RenderOverride(OxyPlot.IRenderContext, Double, Double) at OxyPlot.PlotModel.OxyPlot.IPlotModel.Render(OxyPlot.IRenderContext, Double, Double) at OxyPlot.SharpDX.Wpf.PlotImage.Render(Boolean, Boolean) at OxyPlot.SharpDX.Wpf.PlotView.b__58_0()

@Dunkhan
Copy link
Contributor

Dunkhan commented Mar 22, 2018

I am not able to reproduce this. I am using Win10 and .NET 4.5.2 so it might be related to one of those. Is anyone still having this issue?

@TechnikEmpire
Copy link

TechnikEmpire commented Jun 27, 2018

I'm having the same issue. Win 10 .NET 4.6.1.

@TechnikEmpire
Copy link

Issues persists even in 2.0.0-unstable0956

@TechnikEmpire
Copy link

I fixed it. I'll do a PR.

@TechnikEmpire
Copy link

TechnikEmpire commented Jun 27, 2018

I pushed to the wrong branch in my fork, and I'm way too busy to sort all that out right now. You need to move all of the code inside of InvalidatePlot inside of the dispatcher async invocation call just like this. The secondary, linked issue I reference can be observed by porting over the "Constant Changes" demo. This change fixes both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants