Пример #1
0
        /// <summary>
        /// Get a backup of the memory manager.
        /// </summary>
        /// <returns>A disposable backup that auto-restores when not forgotten.</returns>
        public static Backup GetBackup()
        {
            var backup = new Backup(SINGLETON);

            // Force creating a new instance when Instance is called.
            SINGLETON = null;

            return(backup);
        }
Пример #2
0
 /// <summary>
 /// Forget any backup so that Dispose doesn't use it.
 /// </summary>
 public void Forget()
 {
     m_instance = null;
 }
Пример #3
0
 public Backup(MyMemoryManager instance)
 {
     m_instance = instance;
 }