Skip to content

Commit

Permalink
Merge pull request #990 from rouault/fix_kernel_memleaks
Browse files Browse the repository at this point in the history
Add destructor to Kernel class to fix memleaks
  • Loading branch information
abellgithub committed Sep 11, 2015
2 parents 931e098 + bead179 commit 19fdddf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions include/pdal/Kernel.hpp
Expand Up @@ -72,8 +72,7 @@ typedef std::shared_ptr<PointView> PointViewPtr;
class PDAL_DLL Kernel
{
public:
virtual ~Kernel()
{}
virtual ~Kernel();

// call this, to start the machine
int run(int argc, const char* argv[], const std::string& appName);
Expand Down
12 changes: 12 additions & 0 deletions src/Kernel.cpp
Expand Up @@ -71,6 +71,18 @@ Kernel::Kernel()
{}


Kernel::~Kernel()
{
for (auto & iter : m_public_options)
{
delete iter;
}
for (auto & iter : m_hidden_options)
{
delete iter;
}
}

std::ostream& operator<<(std::ostream& ostr, const Kernel& kernel)
{
ostr << " Name: " << kernel.getName() << std::endl;
Expand Down

0 comments on commit 19fdddf

Please sign in to comment.