Exemple #1
0
        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();
                });
            });
        }
Exemple #2
0
 void TryAndReleaseBuffers()
 {
     if (GraphInst != null)
     {
         GraphInst.ReleaseIntermediateBuffers();
     }
 }