-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory leak? Does this malloc ever get freed? #40
Comments
@rotu you have sharp eyes! As long as the caller dutifully frees the memory all is well, but I never really looked into the details of how the result of deserialization is handled, other than in returning it to the caller of A little bit of digging now tells me that this particular case is never used! It is implemented in the eProsima Fast-CDR library with good reason — that's a generic tool for applications to build upon — but this particular use in Deleting the
I agree with that assessment. What I tried originally was classifying types as primitive or not, then have a single templatized one for all primitive ones and handling the few others with special cases, but I got lost in the C++ template error messages. Macros were simply the quickest way to getting something up and running. Now that times have changed, I'm all for cleaning this up. The best thing would be to rewrite |
I agree that a rewrite is in order, and I’ll pitch in with a few PRs. You may find (as I do) that Clang is tons better than gcc for writing template code. It gives clearer error messages. |
rmw_cyclonedds/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/serdes.hpp
Line 295 in 0e6fd30
There’s a lot of other questionable code in here, including much use of macros where templates would be more appropriate and repeated code.
The text was updated successfully, but these errors were encountered: