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++ Core » This is heap leak? (a Ptr use new,no delete,heap leak)
Re: This is heap leak? [message #61787 is a reply to message #61786] Tue, 02 September 2025 11:26 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1227
Registered: August 2007
Senior Contributor
Hi,

Yes that is a heap leak. You are creating a button on the heap but never deleting it.
Ptr<T> is used for pointing things, not for memory management.
If you want to create ctrls on the heap, you can use containers: One<Buttorn> or Array<Button>.
They can take care of the ownership and track the object life time.

Best regads,
Oblivion


[Updated on: Tue, 02 September 2025 11:27]

Report message to a moderator

 
Read Message icon3.gif
Read Message
Read Message
Previous Topic: VectorMap iteration
Next Topic: Add compilable testcases for nontrivial problems!
Goto Forum:
  


Current Time: Fri Sep 05 19:59:39 CEST 2025

Total time taken to generate the page: 0.06086 seconds