unregistering types

4 posts / 0 new
Last post
Last seen: 1 year 2 weeks ago
Joined: 10/23/2013
Posts: 43
unregistering types

Is there an API that will return the list of registered topics for a given domain participant to determine topics to delete at shutdown? 



Gerardo Pardo's picture
Last seen: 1 month 6 days ago
Joined: 06/02/2010
Posts: 601


Did you mean Topics or Types?  I ask because n DDS speak you 'create' Topics but 'register' types.

Unfortunately I do not think there is an operation to get all the created Topics. It is a good observation. We probably should add one...

The registered types you do need to delete because the TypePlugins are created as a singletons and any state the DomainParticipant saves related to registerd types is deleted when the DomainParticipant is deleted.

If all you want to get the Topics to delete them when you are sutting down, then you may be able to get a similar effect calling the delete_contained_entities operation on the DomainParticipant. This will delete everything the participant contains, including the Topics that it created.


Last seen: 1 year 2 weeks ago
Joined: 10/23/2013
Posts: 43

I meant types.  Is there an API to get a list of types that have been registered so that I can unregister them at shutdown?




rose's picture
Last seen: 2 years 7 months ago
Joined: 08/22/2011
Posts: 148

Hello Mark, 

Right now that functionality does not exist.  On platforms other than Windows, you can call participant->delete_contained_entities() and this will clean up all memory associated with the registered type.  If you are running on Windows, you will see a memory leak at shutdown if you do not unregister the type.  To prevent warnings about memory leaks, I have been storing a map of type names and their associated unregister functions so that I can unregister all types:


You can see the full source file here:


Thank you,