Don't use raw owning pointers. Use std::unique_ptr (or std::shared_ptr) for owning pointers. Only use raw pointers for observing non-owning pointers.this code is not my, if use shared_ptr problem remains. I agree with you, but problem not in it
Also look up RAII.
And don't use threads. Whatever you think you'd gain, you think wrong.then i used thread in training purposes
Are you coming from a Java or C# background, because as Jesper Juhl said, you should use RAII (http://www.bromeon.ch/articles/raii.html).
this code is not my, if use shared_ptr problem remains.The idea is not to use shared pointers. Use pure objects wherever possible, not pointers.
I agree with you, but problem not in itYou talk about memory leaks and show a code that blatantly provokes them... So this is hard to believe.
tool, for example?this code is not my, if use shared_ptr problem remains.The idea is not to use shared pointers. Use pure objects wherever possible, not pointers.I agree with you, but problem not in itYou talk about memory leaks and show a code that blatantly provokes them... So this is hard to believe.
If you're sure that the problem persists, then show the new code. If you write it correctly, the code won't contain a single new keyword.
By the way, to detect memory leaks, you should use a tool designed for that task, not the Windows task manager.
The solution to fix this is to simply reuse the same thread.Bad solution. If i use a lot of draw function and other function, work with lists, in main thread, all this very loaded and becomes visible small hang. Solution was to divide all of different thread.
Bad solution. If i use a lot of draw function and other function, work with lists, in main thread, all this very loaded and becomes visible small hang. Solution was to divide all of different thread.
The solution to fix this is to simply reuse the same thread.Bad solution. If i use a lot of draw function and other function, work with lists, in main thread, all this very loaded and becomes visible small hang. Solution was to divide all of different thread.