15 Apr
2003
15 Apr
'03
10:59 a.m.
Christian Gmeiner wrote:
Hi!
I want to use boost's shared_ptr in my project, which is a dll. At the moment it looks like this:
in the h: extern MY_API CCPUDetect * gCPU;
extern boost::shared_ptr<CCPUDetect> gCPU;
in the cpp: CCPUDetect * gCPU = CCPUDetect::GetInstance();
boost::shared_ptr<CCPUDetect> gCPU(CCPUDetect::GetInstance()); I assume that CCPUDetect::GetInstance() returns a dynamically allocated raw pointer to CCPUDetect. If not, then you shouldn't be using a smart pointer construct such as boost::shared_ptr<>.