Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6761895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:14:46+00:00 2026-05-26T14:14:46+00:00

You can check if an object is null but can you check if an

  • 0

You can check if an object is null but can you check if an object is valid?

Assert.IsValid(object_name);

For example, the object has been deleted by the garbage collector or someone has done dispose on it. But the pointer is still pointing to that object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:14:47+00:00Added an answer on May 26, 2026 at 2:14 pm

    If the object has been freed by the garbage collector, you won’t have a reference to it, by definition.

    If it’s been disposed and that’s important to the object’s validity, the type ought to provide a way of determining that. (In some cases Dispose can just mean “reset”, for example.)

    It’s rarely appropriate to even allow the possibility of having a reference to a disposed object though – if you use:

    using (Foo foo = new Foo())
    {
        ...
    }
    

    then the object will be disposed at the same time that foo goes out of scope, so this isn’t an issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

JNI: How can i check if jobject is a null object in native c
I need to check a generic object for null, or default(T). But I have
In C# I can check if an event has any listeners: C# Example: public
How can i check if a child attribute of a json object is null?
I'm trying to check if an object can cast to a certain type using
I want to check the type of an Object. How can I do that?
I can check for iPhone with this code: (navigator.userAgent.match(/iPhone/i)) But I want to target
How can an application check if the user has the correct key? certificate and
How can I check what objects, tools, variables, anything... are used from .NET 2.0
Can check out here alt text http://51hired.com/static/problem.bmp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.