Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MVM_nativecall_refresh of CStruct always replacing child objects
MVM_nativecall_refresh has never properly handled CStruct, CPPStruct and CUnion members of CStructs, since it always compared the pointer to the 6model object's body with the pointer contained in the referenced C struct. Since those were never the same, we always destroyed any existing child objects. In addition commit e99af05 made it worse by trying to fix handling of inlined attributes while by changing the logic so it could only ever work for inlined attributes. However for inlined attributes we actually don't have to refresh child objects, since they cannot be replaced at all anyway. After all they are not their own entities but just a part of the containing struct. So we will always find them at a fixed offset into this struct. Fix by reverting the faulty commit, taking the correct pointers for comparison and just not compare pointers at all for inlined attributes.
- Loading branch information
Showing
1 changed file
with
39 additions
and
34 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