SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components


The exception happens on the GC finalizer thread and has the following call stack:

SharpDX.dll!SharpDX.ComObject.SharpDX.IUnknown.Release() Line 256 C#
SharpDX.dll!SharpDX.ComObject.Dispose(bool disposing) Line 286 C#
SharpDX.dll!SharpDX.DisposeBase.CheckAndDispose(bool disposing =
false) Line 59 C# SharpDX.dll!SharpDX.DisposeBase.~DisposeBase() Line
28 C# [Native to Managed Transition]
kernel32.dll!00007ffc5c1b1fe4() Unknown
ntdll.dll!00007ffc5d1fcb31() Unknown

I have a single SciChartSurface that is plotting a single FastImpulseRenderableSeries, which is bound using MVVM (SeriesBinding/ImpulseRenderableSeriesViewModel). Only debug builds appear to be affected.

Do I need to be disposing or otherwise cleaning up any of the SciChart objects I create?

Version (from nuget)
  • Andrew
    You don’t have to dispose, but it helps. If the object implements IDisposable, then dispose it (SciChartSurface implements IDisposable). However, all the objects in SciChart also implement the Finalizer which allows them to be disposed if it is not feasible to call dispose. For example its not always feasible to call .Dispose() on a XAML declared UserControl. Regarding the exception, we will need code to reproduce if possible. If you can send it over we’ll be glad to investigate.
  • David La Fleur
    The problem seems to come and go (every time I change code and build, there’s a chance it will go away. But once it’s gone, any change might make it come back). I suspect it’s related to the order the finalizers are called in. Unfortunately showing it to you would mean providing code for the entire product, which I can’t do, but if I manage to reproduce the problem in something smaller, I’ll send that along.
  • Andrew
    Yes Finalizers are executed on another thread so they can be a bit non-deterministic. Do you have a full stack trace? SharpDX finalizes its own objects and we dispose most of them but sometimes something gets missed (like a texture held by a PointMarker)
  • David La Fleur
    Unfortunately, what I posted *is* the complete call stack for the GC finalizer thread where the exception occurs. Or did you want to know what the other threads were doing at the same time?
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.