Пример #1
0
 public override void Dispose()
 {
     if (mTexture.IsDisposed == false)
     {
         mTexture.Dispose();
     }
 }
Пример #2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (mTexture.IsDisposed == false)
         {
             mTexture.Dispose();
         }
     }
 }
Пример #3
0
    static public bool IsInstalled(string inPackageName)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        AndroidJavaObject activity = GetCurrentActivity();
        using (AndroidJavaObject packageMgr = activity.Call <AndroidJavaObject>("getPackageManager"))
        {
            try
            {
                AndroidJavaObject packageInfo = packageMgr.Call <AndroidJavaObject>("getPackageInfo", inPackageName,
                                                                                    packageMgr.GetStatic <int>("GET_SERVICES") | packageMgr.GetStatic <int>("GET_ACTIVITIES"));
                if (packageInfo == null)
                {
                    return(false);
                }

                Ref.Dispose(ref packageInfo);
                return(true);
            }
            catch (Exception e)
            {
                Logger.Log("Unable to get package: {0}", e.Message);
                return(false);
            }
        }
#else
        return(false);
#endif
    }
 protected virtual void SaveLayout()
 {
     Ref.Dispose(ref memoryStream);
     memoryStream = new MemoryStream();
     dockManager.SaveLayoutToStream(memoryStream);
     deserializeButton.IsEnabled = true;
 }
Пример #5
0
 public virtual void Dispose()
 {
     if (Ref != null)
     {
         Ref.Dispose();
         Ref = null;
     }
 }
Пример #6
0
 public void Dispose()
 {
     if (m_DataExportService != null)
     {
         m_DataExportService.Call("finish");
     }
     Ref.Dispose(ref m_DataExportService);
 }
Пример #7
0
 public override void Dispose()
 {
     if (Ref != null)
     {
         Ref.Dispose();
         Ref = null;
     }
 }
 protected virtual void SaveLayout()
 {
     Ref.Dispose(ref dockManagerStream);
     dockManagerStream = new MemoryStream();
     viewsStream       = new MemoryStream();
     serializationViewModel.Store(viewsStream);
     dockManager.SaveLayoutToStream(dockManagerStream);
     deserializeButton.IsEnabled = true;
 }
Пример #9
0
        public static void CacheInvokeAction(string Script, params ScriptArg[] Args)
        {
            object Result = CacheInvokeFunc <object>(Script, Args);

            if (Result is LuaReference Ref)
            {
                Ref.Dispose();
            }
        }
Пример #10
0
        private void ShutdownTelemetry()
        {
#if UNITY_ANDROID
            Ref.Dispose(ref m_TelemetryProxy);
            Ref.Dispose(ref m_ExportProxy);

            m_SendResponseHandler = null;
            m_SyncResponseHandler = null;
#endif
        }
Пример #11
0
        private void ShutdownUserProfile()
        {
#if UNITY_ANDROID
            Ref.Dispose(ref m_UserProfileProxy);

            m_GetUserHandler          = null;
            m_SetAnonUserHandler      = null;
            m_CheckUserChangedHandler = null;
#endif
        }
Пример #12
0
        public void Main(string[] args)
        {
            Ref <TestClass> myref  = new Ref <TestClass>(new TestClass());
            Ref <TestClass> newref = new Ref <TestClass>(myref);

            newref.Dispose();
            myref.Dispose();

            Console.WriteLine("Press a key to finish.");
            Console.ReadKey(false);
        }
Пример #13
0
 public void Dispose()
 {
     if (Action != null)
     {
         if (DisposeResponse)
         {
             Ref.Dispose(ref Response);
             DisposeResponse = false;
         }
         else
         {
             Response = null;
         }
         Action = null;
         s_Pool.Push(this);
     }
 }