Should I remove parented vgui components along with its parent?

function LandName:Init()
self.Button1 = vgui.Create( “DButton”, self )
self.Button1:SetSize( 50, 50 )
self.Button1:SetPos( 5, 5 )
self.Button1:SetText( “One” )

self.Button2 = vgui.Create( “DButton”, self )
self.Button2:SetSize( 50, 50 )
self.Button2:SetPos( 60, 60 )
self.Button2:SetText( “Two” )

function LandName:Close()

–Or should I do it like this?
–function LandName:Close()
– self.Button1:Remove()
– self.Button2:Remove()
– self:Remove()
vgui.Register( “MyVGUI”, Panel, “DFrame” )
Does it really matter or make a difference, maybe someone has a little information on the subject?

No, I don’t think it makes a difference. Removing the parent should also remove everything parented to it.

All you have to do is remove the parent as stated above. Since the children are derived from it’s parent it will also close.

Thanks guys.

You do not have to override Close to make it remove itself when it’s closed.
It’s automatic.

Well, unless you do