After having read CombineTag code, it seems this class is lacking a destructor too. So memory will leak when two types of tags are present. I'm not able to test this case though. So again, adding a proper destructor is the solution: ~CombinedTag() { delete tag1; delete tag2; }