FFImageLoading.Drawables.SelfDisposingBitmapDrawable.SetIsRetained C# (CSharp) Method

SetIsRetained() public method

If you wish to use the instance beyond the lifecycle managed by the caching entity call this method with true. But be aware that you must also have the same number of calls with false or the instance and its resources will be leaked. Also be aware that once retained, the caching entity will not allow the internal Bitmap allocation to be reused. Retaining an instance does not guarantee it a place in the cache, it can be evicted at any time.
public SetIsRetained ( bool isRetained ) : void
isRetained bool If set to true is retained.
return void
        public void SetIsRetained(bool isRetained)
        {
            lock (monitor)
            {
                if (isRetained)
                {
                    retain_ref_count++;
                }
                else {
                    retain_ref_count--;
                }
            }
            CheckState();
        }