|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Heap Leaks Detected
|
|
|
|
|
|
|
Re: Heap Leaks Detected [message #20873 is a reply to message #20868] |
Wed, 15 April 2009 16:11 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Wed, 15 April 2009 07:07 |
mrjt wrote on Wed, 15 April 2009 11:00 |
Doesn't the One<> template provide this functionality?
|
I stand corrected. Forgot about One. Just proves how rarely in need to keep track of resources through pointers .
luzr wrote on Wed, 15 April 2009 12:40 |
Definitely.
Although, according to U++ way of thinking (and as it progresses), One is considered to be a containter. And instead of 'new', I believe it is better to use 'Create' for in-place creation.
|
In place creation is really nice in general. Too bad C++ doesn't offer an in place creation mechanism, something like a delayed constructor.
|
As a matter of fact, I believe it does, the only problem is that for containers, the only constructor possible is default (paremeter-less) one.
But I guess that is only a samall price to pay. I generally consider parametric constructors either special case tools (e.g. Mutex::Lock) or suplementary (FileIn).
Mirek
|
|
|
Re: Heap Leaks Detected [message #21820 is a reply to message #20865] |
Sun, 07 June 2009 00:49 |
sapiency
Messages: 56 Registered: September 2008
|
Member |
|
|
TeCNoYoTTa wrote on Wed, 15 April 2009 10:19 | thanks all ....but i think that the problem in our program is that there is a thread that don't close !! how can we fix this
we made a thread that contains
while(true)
how can we change it to while the program is opened ?
thx in advance
|
just put
while (0 < Thread().GetCount())
{
RLOG("[" << GetSysTime() << "." << "] "
<< __func__ << " Sleep(1) due of " << Thread().GetCount()
<< " Running threads"
);
Sleep(1);
}
in the destructor (for me it was the destructor of the class where the threads were created)
This will prevent to close the gui before the threads are closed.
regards
reinhard
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:42:35 CET 2024
Total time taken to generate the page: 0.01802 seconds
|
|
|