Skip to content

Commit f860911

Browse files
francisco-miguel-almeidameyerj
authored andcommitted
Merge pull request #297 from achim-k/patch-1 into toolchain-2.9.1
Fix memory leak in property decomposition.
2 parents 9a9f4e7 + 2b15565 commit f860911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rtt/types/PropertyDecomposition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ bool typeDecomposition( base::DataSourceBase::shared_ptr dsb, PropertyBag& targe
136136
base::DataSourceBase::shared_ptr converted = clone->getTypeInfo()->decomposeType(clone);
137137
if ( converted && converted != clone ) {
138138
// converted contains another type
139-
targetbag.add( converted->getTypeInfo()->buildProperty(*it, "", converted) );
139+
targetbag.ownProperty( converted->getTypeInfo()->buildProperty(*it, "", converted) );
140140
} else {
141141
// use the original
142-
targetbag.add( newpb );
142+
targetbag.ownProperty( newpb );
143143
}
144144
} else {
145145
assert( recurse_bag->rvalue().size() >= 1 );

0 commit comments

Comments
 (0)