public override void Dispose()
 {
     disposeChilderen();
     if (com != null)
     {
         com.Dispose();
         com = null;
     }
     base.Dispose();
 }
        public DepthStencilState(IDisposableResource parent, IDepthStencilStateDesc desc)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException<Video>();

                com = new DepthStencilStateCom();
                var error = com.Init(video.com, ((DepthStencilStateDesc)desc).com);

                if (error == DepthStencilStateError.DepthStencil) Debug.ThrowError("DepthStencil", "Failed to create DepthStencil");
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }