void TryAndReleaseBuffers() { if (ctk != null) { try { ctk.Cancel(); } catch (Exception e) { Console.WriteLine(e); } } ctk = new CancellationTokenSource(); Task.Delay(250, ctk.Token).ContinueWith(t => { if (t.IsCanceled) { return; } App.Current.Dispatcher.Invoke(() => { ctk = null; GraphInst.ReleaseIntermediateBuffers(); }); }); }
void TryAndReleaseBuffers() { if (GraphInst != null) { GraphInst.ReleaseIntermediateBuffers(); } }