Esempio n. 1
0
                public void Dispose(Process process)
                {
                    if (Parent == null)
                    {
                        Stack?.ReleaseReference();
                        ExecutionQueue?.ReleaseReference();
                        PredicateResultQueue?.ReleaseReference();
                    }
                    else
                    {
                        if (ReferenceEquals(Stack, Parent.Stack) == false)
                        {
                            Stack?.ReleaseReference();
                        }

                        if (ReferenceEquals(ExecutionQueue, Parent.ExecutionQueue) == false)
                        {
                            ExecutionQueue?.ReleaseReference();
                        }

                        if (ReferenceEquals(PredicateResultQueue, Parent.PredicateResultQueue) == false)
                        {
                            PredicateResultQueue?.ReleaseReference();
                        }

                        Parent.ReleaseReference();
                    }

                    InstructionStream.UnlockPointer(InstructionPointer);

                    StartExecutionQueue?.ReleaseReference();
                    InstructionStream.ReleaseReference();

                    process.Context.DisposeContextStateInternal(ContextState);

                    DfaTrails     = null;
                    DfaTrailIndex = -1;

                    Stack               = null;
                    Parent              = null;
                    ContextState        = null;
                    ExecutionQueue      = null;
                    InstructionStream   = null;
                    StartExecutionQueue = null;
                }
                protected override void OnReleased()
                {
                    Stack?.ReleaseReference();
                    ExecutionQueue?.ReleaseReference();
                    PredicateResultQueue?.ReleaseReference();
                    Parent?.ReleaseReference();

                    Stack          = null;
                    Parent         = null;
                    ExecutionQueue = null;

                    base.OnReleased();
                }