smart-pointers
Detecting memory leaks on Ref-counted COM objects (Addref without Release)
I\'m writing a Direct3D 10 application and want to make sure I don\'t have COM objects leaking. Yes, I am wrapping the interfaces with CComPtr, but I\'d like a leak check anyway for the same reason I[详细]
2023-03-28 09:46 分类:问答What does "single allocation" mean for boost::make_shared
In the boost doc of make_shared, it says: Besides convenience and style, 开发者_高级运维such a function is also exception safe and considerably[详细]
2023-03-27 23:14 分类:问答Using smart_pointer and set_new_handler together
Do one need to worry about using set_new_handlers in conjunction with smart or auto pointer\'s or the libraries come packed with handlers with refine开发者_如何学Cd error handling?[详细]
2023-03-27 21:37 分类:问答C++ - Smart Pointers - Casting smart pointers inside templates
I have a complex code base at work, and i created a small example to mimic the problem and here is the below code.[详细]
2023-03-24 12:10 分类:问答How to check memory allocation failures with new operator?
Just recently I switched the language of my project to use C++ from C. With C, I used malloc and after that I check if malloc was successful but with C++, I use \'new\' to allocate memory and I would[详细]
2023-03-23 14:34 分类:问答What is the use of CComPtr over CComQIPtr in COM?
Can any one explain, What is the use of CComPtr over CComQIPtr in COM? CCo开发者_JAVA百科mPtr<ISampleInterface> Sample1;[详细]
2023-03-23 12:02 分类:问答C++ - Smart Pointers - Passing derived class shared pointer to base through template
I have the following and having difficulty resolving the error please help. i have the following class as template definition somewhere.[详细]
2023-03-23 07:00 分类:问答shall I delete smart pointer manually?
This might be a dumb question but I\'m just not sure about the answ开发者_如何学运维er. The following code read a file, and for each line of the file, a smart pointer is created by \"new\". If the sma[详细]
2023-03-20 15:24 分类:问答When should I use raw pointers over smart pointers?
After reading this answer, it looks like it is a best practice to use smart pointers as much as possible, a开发者_如何学运维nd to reduce the usage of \"normal\"/raw pointers to minimum.[详细]
2023-03-20 03:09 分类:问答Strong Pointer causing a heap corruption on application closing when std::vector is present
I am getting a strange heap corruption error during the application close where if a \"std::vector\" is present in my code, AND I am deleted my \"ref_count\" variable. If I don\'t have an std::vector,[详细]
2023-03-18 18:38 分类:问答