I'm currently using DDS Connext v5.0.0, with C++ application.
Are there any restrictions on when a data sample can be deleted after calling the DataWriter write() method?
My application crashes (with seg fault) if I delete the sample immediately after it has been sent, and the sample contains a populated sequence.
Regards John
Hi Harry,
Are you loaning some of the sequences' contents? You won't be able to delete samples right after writing of they are using loaned sequences. In any other case, it should be fine to delete the sample right after writing.
Thanks,
Juanlu
It turns out that one of my data structures contained an uninitialised string.
By initialising the string using DDS_String_dup() the problem has disappeared?
I understand that calling xxxxTypeSupport::create_data() allocates memory for strings? Whereas objects created on the stack are not. Perhaps the DDS was attempting to free unitilialized memory when the object was destroyed?
Hopefully future versions of DDS replace string types (char*) with and STL string, as it currently feels very clunky?
Cheers John
The new DDS C++ PSM and also the IDL to C++11 language mapping both map IDL strings to std::string (or to a type delivering the same API)