Skin destruction policy causing memory leak

In my application I am having multiple screens playing. In one screen, I have a gallery component which will play multiple videos on selection. The component is using a skin part called “vidDisplay” which is an instance of in-built class “VideoDisplay” and the skin is attached at runtime. Now when I switch back to other screen, I see that the skin is not removing its parts (ex:vidDisplay), i.e., “partRemoved” function is not calling causing “vidDisplay” continue to exist in memory, causing memory leak.

When observed the code base, I see that when a component is extending “SkinnableComponent”, mx_internal property “skinDestructionPolicy” is set to “never” by default, which is causing memory leak in my application.

I believe that any of the following will cause “partRemoved” will be called. Please correct me if i am wrong.

  1. When skinpart (ex:vidDisplay) is set to “null”
  2. When skin is changed at runtime by calling attachSkin()
  3. When component is removed from displayList by calling removeElement/removeChild.

Please clarify me about the scenarios where “partRemoved” will be called by the flex framework.

Last question, can we call removeChild/removeElement with skin part components? I am not sure.

Thanks in advance