private void Cleanup(DDS.DomainParticipantFactory f, DDS.IDomainParticipant p) { if (p != null) { p.DeleteContainedEntities(); } if (f != null) { f.DeleteParticipant(p); } }