Cannot access a disposed object

Suddenly I get this error in my application System.ObjectDisposedException: Cannot access a disposed object Object name: 'Android.Graphics.Bitmap'.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Bummer

  • tribaltribal USMember ✭✭✭

    Well, maybe you're disposing a stream before it is being used, or its being accessed out of scope

  • Vinicius_PozzaneVinicius_Pozzane USUniversity

    The object cannot disposed completely then manke a renderer, like this:

    public class CustomLabelRenderer : LabelRenderer
    {
    protected override void Dispose(bool disposing)
    {
    base.Dispose(disposing);
    GC.Collect();
    }
    }

    For me works!!!

  • BjornBBjornB USMember ✭✭✭
    edited January 2017

    @Vinicius_Pozzane said:
    The object cannot disposed completely then manke a renderer, like this:

    public class CustomLabelRenderer : LabelRenderer
    {
    protected override void Dispose(bool disposing)
    {
    base.Dispose(disposing);
    GC.Collect();
    }
    }

    For me works!!!

    For the love of GCs never, ever use this renderer :) (not kidding)

Sign In or Register to comment.