Pending Review
Last Updated: 05 Jan 2021 14:40 by ADMIN
Created by: Piotr
Comments: 1
Category: TimePicker
Type: Bug Report
0

 

 

RadTimePicker objects remain in memory because, in the DateTimePicker class, it subscribe  on event Window.Current.SizeChanged but you never unsubscribe. So it generates memory leaks. The control will never be removed by the GC(garbage collector).

 

 

Source code:

 

 /// <summary>
        /// Initializes a new instance of the <see cref="DateTimePicker"/> class.
        /// </summary>
        protected DateTimePicker()
        {
            var languages = new List<string> { this.CalendarLanguage };
            var calendar = new Windows.Globalization.Calendar(languages, this.CalendarIdentifier, ClockIdentifiers.TwelveHour);
            this.calendarValidator = new CalendarValidator(calendar);
            this.selectorUtcValue = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
            this.utcValue = this.selectorUtcValue;
            Window.Current.SizeChanged += this.Current_SizeChanged;
        }