noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 02 Dec 2012 09:38 AM |
local p = Instance.new("Model") Instance.new("Model", p) p.DescendantRemoving:connect(function(c) return c.Parent end)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
mustyoshi
|
  |
 |
| Joined: 27 Dec 2007 |
| Total Posts: 41651 |
|
|
| 02 Dec 2012 09:53 AM |
Dat memory leak?
~Monica mustyoshi mustyoshi mustyoshi mustyoshi |
|
|
| Report Abuse |
|
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 02 Dec 2012 10:01 AM |
@mustyoshi
I think so. Note that most properties of the descendant that's being removed are still valid; it only throws an exception when reading the Parent property. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2012 10:02 AM |
| I don't understand this so I shouldn't post and just look at it in confusion. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 02 Dec 2012 10:07 AM |
| I'm surprised that the event executes. |
|
|
| Report Abuse |
|
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 02 Dec 2012 10:24 AM |
@Flurite
Yeah, me too. The only thing I can think of is that the garbage collector calls the Destroy method when collecting an Instance. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 02 Dec 2012 10:33 AM |
| Yeah, but also it registers before the model is destroyed. |
|
|
| Report Abuse |
|
|