public void Render(List <DX11Node> windownodes) { foreach (DX11Node windownode in windownodes) { this.ProcessNode(windownode); } if (this.DoNotDestroy == false) { //Call destroy on any pin which has not being used foreach (DX11OutputPin unused in this.lastframepins) { //Check here, at end of render the com objects are already dead try { //In case node has been deleted, we already called dispose if (this.graph.Nodes.Contains(unused.ParentNode)) { IDX11ResourceProvider provider = unused.ParentNode.Instance <IDX11ResourceProvider>(); provider.Destroy(unused.PluginIO, this.context, false); } } catch (Exception ex) { this.logger.Log(ex); } } //Swap pin buffers for next frame List <DX11OutputPin> temp = this.thisframepins; this.thisframepins = this.lastframepins; this.lastframepins = temp; } }
public void Dispose() { foreach (DX11Node node in this.graph.Nodes) { foreach (DX11OutputPin outpin in node.OutputPins) { //Call destroy IDX11ResourceProvider provider = outpin.ParentNode.Instance <IDX11ResourceProvider>(); try { provider.Destroy(outpin.PluginIO, this.context, true); } catch (Exception ex) { logger.Log(ex); } } } }