OpenDDS / OpenDDS

OpenDDS is an open source C++ implementation of the Object Management Group (OMG) Data Distribution Service (DDS). OpenDDS also supports Java bindings through JNI.
http://www.opendds.org
Other
1.28k stars 463 forks source link

Memory leak problem when using reader->get_topicdescription()->get_type_name() #4566

Closed NawTun closed 1 month ago

NawTun commented 1 month ago

I used the following statement in the ReaderListenerImpl::on_data_available to get the topic type name. const char* type_name = reader->get_topicdescription()->get_type_name(); I found that the memory occupied by the process has been growing. After debugging, I found that the function get_type_name has been allocating memory, but the allocated memory does not seem to be released. Do I need to release it manually, or should I use another function to obtain the type name?

jwillemsen commented 1 month ago

See https://opendds.readthedocs.io/en/latest-release/devguide/getting_started.html#registering-the-data-type-and-creating-a-topic

NawTun commented 1 month ago

Thanks so much!