예제 #1
0
        public NeedsFreeContent FreeContent(IILGen ilGenerator, Action <IILGen> pushReaderOrCtx)
        {
            var needsFreeContent = NeedsFreeContent.No;
            var type             = HandledType();

            foreach (var st in _objectDB.GetPolymorphicTypes(type))
            {
                UpdateNeedsFreeContent(st, ref needsFreeContent);
            }
            if (!type.IsInterface && !type.IsAbstract)
            {
                UpdateNeedsFreeContent(type, ref needsFreeContent);
            }

            ilGenerator
            .Do(pushReaderOrCtx)
            .Callvirt(() => default(IReaderCtx).FreeContentInNativeObject());
            return(needsFreeContent);
        }