We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cannot access a disposed object. Object name: 'BadgeRenderer'.

Thread ID:

Created:

Updated:

Platform:

Replies:

150095 Dec 19,2019 09:32 PM UTC Dec 20,2019 03:26 PM UTC Xamarin.Forms 1
loading
Tags: SfBadgeView
Another XamarinDev
Asked On December 19, 2019 09:32 PM UTC

When you place badge inside list view, like so




where template is like this, where color bind to a property





then if you make a record visible, then scroll to it will be hidden. and programmatically (i.e. from pull to refresh) refresh the view (i.e.
this.model.Orders[this.model.Orders.Count - 1].OrderStatusColor = Colors.Black;

this.ordersListView.RefreshListViewItem(-1, this.model.Orders.Count - 1, true);
)
you get above exception
at Foundation.NSObject.get_SuperHandle () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:449
at UIKit.UIView.get_Layer () [0x00025] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIView.g.cs:4105
at Syncfusion.XForms.iOS.BadgeView.BadgeRenderer.ResetLayer () [0x00000] in <87ce8985515944cbb57a02ad17819328>:0
at Syncfusion.XForms.iOS.BadgeView.BadgeRenderer.InvalidateRenderer () [0x00000] in <87ce8985515944cbb57a02ad17819328>:0
at Syncfusion.XForms.iOS.BadgeView.BadgeSetting.set_BackgroundColor (UIKit.UIColor value) [0x0001f] in <87ce8985515944cbb57a02ad17819328>:0
at Syncfusion.XForms.iOS.BadgeView.BadgeViewUtility.OnBadgeSettingsPropertyChanged (Syncfusion.XForms.iOS.BadgeView.BadgeSetting nativeSettings, Syncfusion.XForms.BadgeView.BadgeSetting formsSettings, System.String propertyName) [0x001df] in <87ce8985515944cbb57a02ad17819328>:0
at Syncfusion.XForms.iOS.BadgeView.BadgeSetting.FormsSettings_PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0000d] in <87ce8985515944cbb57a02ad17819328>:0
BTW, I can't help notice that your BadgeSettings class have an empty IDisposable implementation. Considering it contains other disposable objects it should be changed to dispose/clear references as well
public void Dispose()
{
Dispose(disposing: true);
}

protected virtual void Dispose(bool disposing)
{
}


Vignesh Ramesh [Syncfusion]
Replied On December 20, 2019 03:26 PM UTC

Hi Ilya, 

Greetings from Syncfusion. 

We have prepared the simple sample by placing the SfBadgeView inside the ListView and checked the reported crash. But we afraid that, we are not able to reproduce the reported issue in our side. However, we have fixed the issue using the provided stack trace. Please find the patch for the issue and can be downloaded from the below link.    
   
Please find the patch setup from the below location.    

or    
   
Please find the patch assemblies from the below location.    
   
or   
   
Please find the NuGet from the below location.    
   
Please let us know if you have any other queries.   
   
Assembly Version: 17.4.0.39     
     
Disclaimer:    
Please note that we have created this patch for version 17.4.0.39 specifically to resolve the issue reported in the forum 150095. If you have received other patches for the same version for other products, please apply all patches in the order received.    
   
Also, clear the previous NuGet caches as mentioned in this link and confirm us whether the reported problem is resolved at your end. 

Regards, 
Vignesh.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon