Opened 12 years ago
Closed 12 years ago
#4483 closed Bugs (invalid)
[serialization] test_non_default_ctor2.cpp leaks FloatValueHolder instance
Reported by: | anonymous | Owned by: | Robert Ramey |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost Development Trunk | Severity: | Cosmetic |
Keywords: | Cc: |
Description
The testcase should serialize member A::floatValue
(type FloatValueHolder*
) by value instead of through a pointer.
Serializing through a pointer causes the instance created by A
's c'tor to be overwritten by a newly created instance, leaking the original.
Using
ar & BOOST_SERIALIZATION_NVP(*floatValue)
instead fixes the problem
Note:
See TracTickets
for help on using tickets.
This can't be correct.
ar & * x
wouldn't likely give what is desired. I works around version among other things.
If the test is leaking memory, I would be an issue with test itself rather than the library. You could send a suggested patch for the test if you want. But, I'm sure this applies to lots of tests as well as some or all of the demos. The first demo in the tutorial leaks memory. I tolerate this since I didn't want the tutorial clouded up with issues unrelated to the serialization library.
Robert Ramey