Skip to content

Conversation

@austin-beer
Copy link
Contributor

I didn't create an associated issue for this. I just discovered this minor problem while reviewing the Poco code. The identical code in JSON::Array sets _modified to false, so I think it should do the same in JSON::Object.

@austin-beer
Copy link
Contributor Author

The builds failed due to a null pointer exception in one of the unit tests. I don't have time to look into why, but if someone else wants to take a look, please feel free to!

Header file (JSON/include/Poco/JSON/Object.h):

Replaced single _modified flag with two separate flags: _structModified and _ordStructModified
Updated remove() inline function to set both flags
Implementation file (JSON/src/Object.cpp):

Updated all constructors and assignment operators to use both flags
Copy constructor now properly copies both _pStruct and _pOrdStruct based on their respective modified flags
operator const DynamicStruct&() now uses _structModified
operator const OrderedDynamicStruct&() now uses _ordStructModified
set() and clear() methods set both flags to true
@aleks-f aleks-f merged commit 2baa400 into pocoproject:main Dec 9, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants