Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fixed] fix pitfall when using == and != with MangedWeakReference #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 25, 2022

  1. [fixed] fix pitfall when using == and != with MangedWeakReference

    The following steps should illustrate the problem:
    
    1. Object A is freshly constructed and gets an _objectID of 0.
    2. ManagedWeakReference of A is created -> savedObjectID will be also 0
    3. ObjectManager::persist is called and A gets a validi _objectID
    4. ManagedWeakReference of A will still have the savedObjectID of 0
       and will result in wrong behaviour of == and !=
    
    To circumvent these this commit changes the case when one of the
    compared ManagedWeakReference instances has a savedObjectID of 0 and
    checks the actual reference object for the real _objectID.
    fallchildren2 committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    1031682 View commit details
    Browse the repository at this point in the history