Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8179827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:05:03+00:00 2026-06-07T00:05:03+00:00

General wisdom is when you remove a component from the stage you also need

  • 0

General wisdom is when you remove a component from the stage you also need to manually remove all children so they are not floating in memory. Because they are just none visible since the parent container was removed.

Example of this would be a Label component inside of a BorderContainer. My understanding is you need to remove the Label first then the BorderContainer.

When you create a component such as TitleWindow the default skin for it adds a closeButton to the title bar / header.

I added an event listener to the close button. TitleWindow.closeButton.addEventListener(); In the function called by the close button event i want to close/remove the window.

My question is this. Do i need to manually remove the closeButton as a child of the TitleWindow? Or do i just remove the listener then remove the TitleWindow from the stage and the components created by the skin are automatically removed / garbage collected?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:05:05+00:00Added an answer on June 7, 2026 at 12:05 am

    If a component is removed from the stage, all of its children will automatically be removed and garbage collected as long as you’ve removed al event listeners. So you don’t need to explicitly remove the children in order for them to be garbage collected.

    BUT in your question you refer to skins. When skins are used their host component’s skinDestructionPolicy property is always set to never (that is except for one mobile class; I forgot which one). This means that a skin and all of its children will simply stay in memory forever and never get garbage collected.

    Now the not-so-happy part: it is not easy to override this default setting. Read this question and the answer I’ve written there to see how it can be done: Spark SkinnableComponent skinDestructionPolicy

    Note that in 99% of the cases this default behaviour is really not an issue. Of course I do not know your specific situation, so I can’t comment any further on that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

General javascript question here, which would also be good to know how(if possible) to
General use case I am trying to implement a basic shell. Description I need
In general, I have the following scenario: Fetch product and its related data from
The prevailing wisdom in webservices/web requests in general is to design your api such
In general, I know that int32 errors mean that a string value is not
I am looking for some general wisdom here. I am looking for an elegantly
general question it can be in c i guess also if i have (
GENERAL XML OUTLINE: <dasbhoards> <dashboard name=S1> <repository-location derived-from='http://dataviz.win.compete.com/workbooks/OTCSurvey_06_15_11_16_54/RT4?rev=' id='RT4' path='/workbooks/RetailFootwear' revision='' /> <style> </style>
General Follow the same standards for all tests. Be clear about what each test
General question How can I tell git , that it should also count empty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.