Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - valerion

Pages: [1]
1
System / Re: leak ram
« on: October 04, 2015, 01:01:58 am »
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.

2
System / Re: leak ram
« on: October 02, 2015, 11:25:52 pm »
on one forume i got this answer:
Problem is that when creating in thread, creates a hidden context opengl and added to "global basked"(std::set <GlContext*> internalContext) and at destruction thread isn`t released.

3
System / Re: leak ram
« on: October 02, 2015, 11:18:37 pm »
new code without pointers :D
main.h
(click to show/hide)

main.cpp
(click to show/hide)
old problem remains

4
System / Re: leak ram
« on: October 02, 2015, 11:14:37 pm »
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 it
You 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.
tool, for example?

5
System / Re: leak ram
« on: September 29, 2015, 06:47:57 pm »
And don't use threads. Whatever you think you'd gain, you think wrong.

Are you coming from a Java or C# background, because as Jesper Juhl said, you should use RAII.
then i used thread in training purposes

6
System / Re: leak ram
« on: September 29, 2015, 06:36:49 pm »
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.
Also look up RAII.
this code is not my, if use shared_ptr problem remains. I agree with you, but problem not in it

7
System / leak ram
« on: September 29, 2015, 11:19:00 am »
sorry for my endlish... :-[
At first it was so
(click to show/hide)
(click to show/hide)
screen 1: "Failed to activate the window's context"

after correction:
void Main::THREAD_Draw()
void Main::THREAD_Draw()
{
        window->draw(*shape1);
        window->draw(*shape2);
        window->setActive(false);
}
it was like on screen 2: leak RAM

Pages: [1]