UELib.Core.UObject.MaybeDisposeBuffer C# (CSharp) Метод

MaybeDisposeBuffer() приватный Метод

private MaybeDisposeBuffer ( ) : void
Результат void
        internal void MaybeDisposeBuffer()
        {
            //Console.WriteLine( "Disposing buffer for {0}", (string)this );

            // Do not dispose while deserializing!
            // For example DecompileDefaultProperties or DecompileScript, may dispose the buffer in certain situations!
            if( _Buffer == null || (DeserializationState & ObjectState.Deserializing) != 0 )
                return;

            _Buffer.DisposeBuffer();
            _Buffer = null;
            //Console.WriteLine( "Disposed" );
        }

Usage Example

Пример #1
0
        public string Decompile()
        {
            _TempFlags = 0x00;
            string value;

            _Container.EnsureBuffer();
            try
            {
                value = DeserializeValue();
            }
            catch (Exception e)
            {
                value = "//" + e;
            }
            finally
            {
                _Container.MaybeDisposeBuffer();
            }

            // Array or Inlined object
            if ((_TempFlags & DoNotAppendName) != 0)
            {
                // The tag handles the name etc on its own.
                return(value);
            }
            string arrayindex = String.Empty;

            if (ArrayIndex > 0 && Type != PropertyType.BoolProperty)
            {
                arrayindex += "[" + ArrayIndex + "]";
            }
            return(Name + arrayindex + "=" + value);
        }