-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
1 parent
e5ea329
commit 896d66a
Showing
1 changed file
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters