Closed chrberger closed 6 years ago
The direct use of raw pointers created with new bear the risk of leaking memory. Thus, better create only wrapped pointers:
new
#include <memory> shared_ptr<MyClass> ptrToMyClass = std::make_shared<MyClass>(); ...
cf. http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared
This issue has been addressed in this commit.
The direct use of raw pointers created with
new
bear the risk of leaking memory. Thus, better create only wrapped pointers:cf. http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared