コード例 #1
0
        /// <summary>
        /// This is the lock free version of uninitilize so we can share
        /// it between the public method and error paths inside initialize.
        /// This should only be called inside a lock(initLock) block.
        /// </summary>
        private static void InternalUninitialize()
        {
            // Update this first so IsInitialized immediately begins returning
            // false.  Since this method should be protected externally by
            // a lock(initLock) we should be able to reset everything else
            // before the next init attempt.
            isFullyInitialized = false;

            LimitManager.UnInitialize();

            if (RuntimeClient.Current != null)
            {
                try
                {
                    RuntimeClient.Current.Reset();
                }
                catch (Exception) { }

                RuntimeClient.Current = null;

                try
                {
                    ClientProviderRuntime.UninitializeSingleton();
                }
                catch (Exception) { }
            }
            outsideRuntimeClient = null;
        }