Memory leak on Windows
Simple code leaks. While comment out a little code of poppler, no leak any more.
The code leak on Windows
#define WXUSINGDLL
#include <wx/log.h> // this leads to memory leak, if comment out this line, no memory leak will
#include <poppler/cpp/poppler-page.h>
int main()
{
poppler::page * __page = nullptr;
if (__page != nullptr)
delete __page;
return 0;
}
When comment out the 2 parts of class page as below, no leak. And uncomment any will lead to memory leak
class POPPLER_CPP_EXPORT page// : public poppler::noncopyable
{
public:
...
// ~page();
...
}
class POPPLER_CPP_EXPORT noncopyable
{
public:
noncopyable(const noncopyable &) = delete;
const noncopyable &operator=(const noncopyable &) = delete;
protected:
noncopyable();
~noncopyable();
};
The other way, comment out #define WXUSINGDLL
also leads to no leak.