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 » Developing U++ » U++ Developers corner » Proposed change to U++ to allow owning children.
Re: Proposed change to U++ to allow owning children. [message #32081 is a reply to message #32080] Wed, 20 April 2011 21:38 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
Detach is implemented as protected. Intended for libary developer or person who knows how to handle it as it opens the door for possible leaks!

Also, there is one step I omitted. The owned flag should be unset in Ctrl copy constructor. If pick semantics is guaranteed, this will not be an issue. There is something we need to worry about only when there is prospect that the fix will be included into the library.

The reason being, a programmer may copy a dynamically created Ctrl to a stack allocated object. If this happen, the owned flag is wrongfully set and will lead to memory corruption. The move constructor (pick semantics) should always be preferred. The copy constructor should be "protected" so that it's available only to library developer or person know its potential danger.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Get MAC addresses for windows and linux
Next Topic: Testing framework in U++.
Goto Forum:
  


Current Time: Sat Aug 30 00:32:11 CEST 2025

Total time taken to generate the page: 0.01204 seconds