Closed iwbnwif closed 8 years ago
The fix for this appears to be as simple as copying the latest mapbox::variant files variant.hpp
and recursive_wrapper.hpp
over the existing ones the Ponder include/ponder/detail folder
.
Note: The recursive_wrapper.hpp
seems to be renamed variant_recursive_wrapper.hpp
in Ponder.
I added a test based on your code:
TEST_CASE("Values can be held in containers")
{
SECTION("a std::map")
{
std::map<std::string, ponder::Value> testmap;
ponder::Value value = "Hello";
testmap["1"] = value;
REQUIRE(testmap["1"] == std::string("Hello"));
}
}
This passes on all of the test platforms, so possibly this is a problem with your compiler or the library it uses? I will update the Variant code though.
Current version 1.1.0 of Mapbox variant added. See https://github.com/billyquith/ponder/commit/2099d627ee516467147a1a65e4f07a6ed50c7f85. Hopefully this should fix your issue. Cannot replicate.
Thank you, I can confirm that this is now fixed on my TDM-GCC64 setup.
I am using TDM MinGW64 on Windows 10.
There is a problem when a std::map containing ponder::Value objects goes out of focus. It calls the dtor for the Value objects, but the dtor seems to have problems freeing the memory.
Here is a simple test case to reproduce the problem:
And here is the back trace that leads to the SIGTRAP
Therefore I think that this is actually a mapbox::variant problem and not specific to Ponder.
For reference, the following works as expected: