Page MenuHomePhabricator

FlexArray memory leak case
ActivePublic

Authored by mduminer on Dec 20 2019, 10:11 AM.
hpp file:
#include "pawlib/flex_array.hpp"
#include <iostream>
#include <memory>
class Container
{
public:
Container();
private:
std::shared_ptr<FlexArray<FlexArray<int>>> array;
};
void test_flex_array();
cpp file:
#include "sandbox/flex_array_test.hpp"
Container::Container()
{
array = std::make_shared<FlexArray<FlexArray<int>>>();
for (int i = 0; i < 20; ++i)
{
std::cout << "Preparing to push inner # " << i << std::endl;
auto inner = FlexArray<int>();
array->push(inner);
}
}
void test_flex_array()
{
Container();
}