|
|
Home » Developing U++ » U++ Developers corner » Proposed change to U++ to allow owning children.
Re: revised ownership change [message #32171 is a reply to message #32170] |
Thu, 28 April 2011 23:54   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
In the rare case where we are destructing its parent but could not make up our mind whether we are going to delete it or assign it to yet another parent (not decided at the moment), we can use a dirty trick to circumvent the no-reattachment limitations,
{
// p is pointed to a dynamically created child
ParentCtrl tmp;
tmp.Add(p); // or should it be *p? I rely on TheIDE on this
// now p is no longer part of its previous parent's
// child tree.
// Destruct its previous parent to free precious memory resource :)
// and since *p belongs somewhere else, it will not be touched.
// a thousand lines/function calls to make up our mind whether
// we are going to destruct *p or add it to another parent.
if( newdad !=NULL)
newdad->Add(p);
// we don't even need to detach and delete, as p will be
// destructed with tmp at the end of the code block
// if a newdad is not successfully found.
// this is the expected behavior
}
[Updated on: Thu, 28 April 2011 23:59] Report message to a moderator
|
|
|
 |
|
Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 17:18
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Wed, 16 March 2011 17:26
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 17:29
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 17:30
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 17:39
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Wed, 16 March 2011 18:01
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 18:10
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 18:29
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 18:35
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 18:43
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 16 March 2011 19:24
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 02:13
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Fri, 18 March 2011 11:01
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 14:39
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 15:21
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 15:40
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 16:22
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 16:34
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: mirek on Fri, 18 March 2011 19:35
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: mirek on Fri, 18 March 2011 19:32
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 23:02
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: mirek on Fri, 18 March 2011 23:18
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Fri, 18 March 2011 23:34
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: mirek on Fri, 18 March 2011 23:40
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sat, 19 March 2011 00:02
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: mirek on Sat, 19 March 2011 00:37
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sat, 19 March 2011 01:30
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sat, 19 March 2011 01:35
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: mirek on Sat, 19 March 2011 10:59
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Sun, 20 March 2011 10:32
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sun, 20 March 2011 14:07
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sun, 20 March 2011 14:11
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sun, 20 March 2011 14:28
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Fri, 25 March 2011 13:26
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Sun, 27 March 2011 15:33
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Sun, 17 April 2011 17:25
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Tue, 19 April 2011 06:00
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Tue, 19 April 2011 09:14
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Tue, 19 April 2011 14:09
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Tue, 19 April 2011 18:05
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 20 April 2011 02:44
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Wed, 20 April 2011 08:51
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 20 April 2011 19:24
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 20 April 2011 21:17
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 20 April 2011 21:23
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: Lance on Wed, 20 April 2011 21:38
|
 |
|
Re: Proposed change to U++ to allow owning children.
By: kohait00 on Thu, 28 April 2011 16:32
|
 |
|
revised ownership change
By: kohait00 on Thu, 28 April 2011 18:28
|
 |
|
Re: revised ownership change
By: Lance on Thu, 28 April 2011 21:45
|
 |
|
Re: revised ownership change
By: kohait00 on Thu, 28 April 2011 21:57
|
 |
|
Re: revised ownership change
By: Lance on Thu, 28 April 2011 23:18
|
 |
|
Re: revised ownership change
By: Lance on Thu, 28 April 2011 23:31
|
 |
|
Re: revised ownership change
By: Lance on Thu, 28 April 2011 23:54
|
 |
|
Re: revised ownership change
|
 |
|
Re: revised ownership change
|
 |
|
Re: revised ownership change
|
 |
|
Re: revised ownership change
By: Lance on Mon, 06 June 2011 05:11
|
 |
|
Re: revised ownership change
By: Lance on Mon, 06 June 2011 05:05
|
Goto Forum:
Current Time: Fri Aug 29 22:40:52 CEST 2025
Total time taken to generate the page: 0.04653 seconds
|
|
|