Coffeehouse Post

Single Post Permalink

View Thread: Question on C# Threads
  • User profile image

    The OP's original question has not been answered. I think there is something going on there because if you first call foo() and then later bar(), there is no way that there could be a null ref exception in bar(). someThread will not be set to null automatically. We are not seeing all of the code so we can't answer that question.

    Maybe someThread is really a static in the actual code and it is being set to null in the constructor? That would cause one instance to set it to null after another instance is using it. Just guessing since we don't have all of the code.