Possible bug in List.cs

Hi All,

Today I ran into an uncaught exception System.NullReferenceException in the Glide module mentioned above.

I think there might be a bug in GHIElectronics.NETMF.Glide.UI.List::Dispose(), according to me there should be a check if the bitmap being disposed has been assigned in the 1st place. In other words:

Current code:


        /// <summary>
        /// Disposes all disposable objects in this object.
        /// </summary>
        public override void  Dispose()
        {
            _bitmap.Dispose();
        }

should be (according to me):


        /// <summary>
        /// Disposes all disposable objects in this object.
        /// </summary>
        public override void  Dispose()
        {
            //Prevent "Null reference exception"
            if (_bitmap != null)
            {
                _bitmap.Dispose();
                _bitmap = null;
            }
        }

Is this the right place to report this kind of info?

TIA Jos

It is. Thanks.

Is there anybody to take this change and update the source then?
Or am I able/allowed to do it myself?

Glide is now open source. You are allowed to update it.

This change has been committed.