Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

  • Music:

Hrm.

Perhaps this is the problem.... the reference-counting mechanism on my LJRequest object is used like this:
    if (m_reqLoadFriendOf)
        m_reqLoadFriendOf->RemoveRef();
    
But the problem is that if the RemoveRef() actually does end up deleting the object, nothing ever nulls out the request object pointer. I need to change the RemoveRef prototype to be like:
    LJRequest::RemoveRef (LJRequest *&reqPtr);
    
That way I can check if it's non-null (instead of the client-code needing to do it), free it, and set it back to NULL when it's actually freed. None of this would be necessary if I were using Java. Of course, Microsoft doesn't support Java anymore... I supposed I could one day write it in MS-proprietary C# (C-Sharp).. ha!
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 2 comments