C++ static classes & shared_ptr memory leaks
- by HardCoder1986
Hello!
I can't understand why does the following code produce memory leaks (I am using boost::shared_ptr with static class instance). Could someone help me?
#include <crtdbg.h>
#include <boost/shared_ptr.hpp>
using boost::shared_ptr;
#define _CRTDBG_MAP_ALLOC
#define NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
static struct myclass {…