Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Intresting "Heap leaks detected" warning
Intresting "Heap leaks detected" warning [message #6569] Sun, 19 November 2006 09:43 Go to next message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
bool URightCtrl::ShowSys(String id,String name)
{
if(!odb().IsDbAlive())return false;
viewS1.m_SysTitle.SetLabel("当前系统:"+name);//显示当前系统名称
USQLite3DB& data=odb().database();
USQLite3Table tab;
String sql="select syNQty,syCQty from System where syId="+id;
try
{
tab=data.GetTable(sql);
viewS1.m_Matrix.SetRowCol(atoi(tab.fieldValue(1)),((atoi(tab .fieldValue(0))) >>1));
tab.finalize();
}
catch(USQLite3Exception &e)
{
PromptOK(e.errorMessage());
tab.finalize();
return false;
}

return true;
}

Without last "return true;" line,program claim a "Heap leaks detected" warning
caller is:
if(!right->ShowSys(m_Tree1.Get(cursor),m_Tree1.GetValue(cursor)))
{PromptOK("can't load Systems.");}

[Updated on: Sun, 19 November 2006 09:51]

Report message to a moderator

Re: Intresting "Heap leaks detected" warning [message #6578 is a reply to message #6569] Sun, 19 November 2006 14:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Interesting. Well, if it is bool method, it _needs_ return statement, otherwise the behaviour is undefined. Still it is interesting that destructors seem not called.

What compiler (platform) is that?

Mirek
Re: Intresting "Heap leaks detected" warning [message #6596 is a reply to message #6578] Mon, 20 November 2006 01:35 Go to previous messageGo to next message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
luzr wrote on Sun, 19 November 2006 08:53



What compiler (platform) is that?

Mirek

611-dev2,WindowsXP-SP2,VC2003Tookit
thanks!
Re: Intresting "Heap leaks detected" warning [message #6616 is a reply to message #6596] Mon, 20 November 2006 21:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I think this is the good issue to remember (if you have leaks, check that you have all returns Wink

I noticed a while ago that VC compilers do not report missing return statements.. Something is wrong there.

Mirek
Re: Intresting "Heap leaks detected" warning [message #6624 is a reply to message #6616] Tue, 21 November 2006 01:30 Go to previous message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
Yes,this is why I write it here.
Previous Topic: Help:Capture USB Device message
Next Topic: How to show a ButtonOption in a cell of a the GridCtrl
Goto Forum:
  


Current Time: Fri Mar 29 14:54:31 CET 2024

Total time taken to generate the page: 0.01650 seconds