void OnDestroy()
    {
        isDestroyed = true;

        if (hqTextureHandler != null)
        {
            hqTextureHandler.Dispose();
            hqTextureHandler = null;
        }

        if (gifPlayer != null)
        {
            gifPlayer.OnFrameTextureChanged -= UpdateTexture;
            gifPlayer.Dispose();
        }

        if (assetPromise != null)
        {
            assetPromise.Forget();
            assetPromise = null;
        }

        if (backgroundMaterial != null)
        {
            Object.Destroy(backgroundMaterial);
        }
        if (imageMaterial != null)
        {
            Object.Destroy(imageMaterial);
        }
    }
Exemplo n.º 2
0
 void OnDisable()
 {
     isEnabled = false;
     gifPlayer.Dispose();
     ClearTimeline();
     notes.Clear();
 }
Exemplo n.º 3
0
 private void FrmGif_FormClosing(object sender, FormClosingEventArgs e)
 {
     _gif.Dispose();
 }