Garbage collection and dictionary with weak reference

Hello

I'm quite confused by this one. Dictionary with weak reference seems to actually keep it. Here's my code:

...

private var _Tester: Object = {name: 'test'};

private var _dict: dictionary = new Dictionary (true);

...

_dict [0] = _Tester;

_Test = null;

...

System.GC();

...

trace (_dict [0] .name); outputs 'test '.

Any ideas why system.GC() didn't release the object even if the only strong reference (_test) has been cancelled?

I tried to wait long, forcing GC repeatedly - nothing.

Thank you

the keys are small, not values.  use:

_dict [_test} = ' something like: test ";]

In addition, System.GC() when first run will mark objects for gc.  the next time it runs (after a tick enterframe), he should sweep.    but I add a third call to ensure that the gc run because I found that it sometimes not sweep on the 2nd call.

Tags: Adobe Animate

Similar Questions

  • Interpolation and Garbage Collection problem

    No matter what I I can not solve a problem with AS3 Garbage Collection of tween I'll have it is havoc on my tween instances works correctly/consistently. Some Sprites never tween at all, some do it but only part way. And it different effects almost every time.

    I recently read about AS3 Garbage Collection and badly referenced interpolations and other asynchronous forums is picked up in the Middle process fairly. I feel the inconsistent behavior of signature that the I have read.

    I tried to use the static properties level and not static class to store the references to my Tween instances so that they will not be shown for the GC. No luck. I placed references to these in the class-level tables, I also used static to() TweenMax method, which ensures that there will be the shield of GC and its static constructor instantiation not alt., with persistence: true. I have also set up another package custom; GCSafeTween(), others says it's as it should be, but it does not work in my case.

    To test the GC problem, I edited the two eventListerners() in the Adobes fl.transitions.Tween so that their default weakReference property was false. This is properly the work of Tween. But this is a terrible solution.

    Here is my code. Its a bit stripped down just to show the configuration.
    Thank you for helping me solve this one!


    The problem is finally solved.
    I had another Alpha tween StackDisplay targeting a Sprite that is nested inside the main Sprites that I tried to tween Alpha. I noticed that if I planned other properties of the target Sprites they work always as interpolated. It was only the Alpha which would get stuck from time to time.

    JPSoul thanks for helping me to tackle the problem in a different way and get finally resolved.

    FYI here is the line that caused the issue:

  • Question of weak references

    In general, I always use weak references when adding listeners. However this am I had tripped upward for some time, doing so and want to dig deeper and understand why the GC instantly removed the listener. So, here's the barebones of the class:

    public class smoke

    {

    private var clip: MovieClip;

    private var container: DisplayObjectContainer;

    public void Smoke($clip:MovieClip,_$container:DisplayObjectContainer,_x:int,_y:int):void

    {

    Clip = $clip;

    container = $container;

    clip.x = x;

    clip.y = y;

    clip.addEventListener (Event.ENTER_FRAME, update, false, 0, true);

    }

    private void update(e:Event):void

    {

    clip.Alpha-=. 01;

    If (clip.alpha < = 0) {}

    container.removeChild (clip);

    clip.removeEventListener (Event.ENTER_FRAME, update);

    }

    }

    In the constructor, when I add the listener enter_frame, using a weak reference, as shown, update never gets called... with the help of a strong reference works fine however. So, why the GC instantly removes the listener in this case?

    DOH! Nevermind, I thought about my own question as soon as I aksed it... is not always occur? Because the clip has not been added to the display list, the headset has been removed. The manufacturer just need: container.addChild (clip); and then the weak reference works as expected.

  • When creating collections and nodes via PHP setting is not the storage schema

    Hello!
    I am trying to create cat Collection and nodes with PHP backend.
    I use this setup as the basis for all nodes with small changes:

    static private $CHAT_CONFIGURATION = array(
       'accessModel'=>self::ROLE_VIEWER,
       'publishModel'=>self::ROLE_VIEWER,
       'persistItems'=>true,
       'modifyAnyItem'=>false,
       'userDependentItems'=>false,
       'sessionDependentItems'=>false,
       'itemStorageScheme'=>self::STORAGE_SCHEME_QUEUE,
       'allowPrivateMessages'=>false,
       'lazySubscription'=>false,
       'p2pDataMessaging'=>false
    );
    

    STORAGE_SCHEME_QUEUE = 1
    And this value has changed not for any node of hostory_ *.
    But when the node created I'm trying to use the chat and may not serve more than one value. Then I checked the configuration of the node from room console and found that this storage system has the value ITEM UNIQUE. When I changed it (using the room console) to TAIL cat began to work properly. How to set up the storage system correctly?
    Thank you!

    Well, I still don't know what it is.

    I tried your code and it works fine for me. After you run your 'createSession_chat' on a room newly created, I call getNodeConfiguration on the new nodes and that's what I get:

    -ALL-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? path = / chat_1/nodes/history/config print

    10.0 true false 1.0

    -PARTICIPANTS-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? quotes/configuration of the path = / chat_1/nodes/history_partic

    10.0 50.0 faux 1.0

    -HOSTS-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? path = / chat_1/history_hosts/nodes/configuration

    10.0 100.0 false 1.0

    -TYPING-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? ration = / chat_1/nodes/typing/adjustment path

    true 10.0 false 2.0 true

    ItemStorageScheme values match the values you used during the creation of nodes.

    Not sure what disaster happens with the Whiteboard because everything you showed us so far was connected to the nodes of cat, and I guess that I have no intention to proceed with changes to the PHP code since everything seems to work as specified.

  • Some Garbage Collection issues

    I searched the Garbage Collection, and I still have some doubts. Consider the following code:

    var objt:Sprite = new Sprite();

    var child: Sprite = new Sprite();

    stage.addChild (obj);

    obj.addChild (child);

    obj.addEventListener (MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);

    child.addEventListener (MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);

    Suppose I want to get rid of (delete, delete, destroy, purge, KILL >: D) everything about obj (itself, its events, its children and its event listeners listeners). Is the following code enough? :

    stage.removeChild (obj);

    obj.removeEventListener (MouseEvent.MOUSE_DOWN, onMouseDown);

    Delete obj;

    Yes.  shortly after this code executes both obj and child will be gc would have.

  • How to prepare list for garbage collection after drag and drop operation

    Hi all

    I have a view in a mobile application that contains a list with the help of drag / move. The problem I encounter is that the NativeDragManagerImpl maintains a reference to this list in its _dragInitiator and _relatedObject properties. It is not a memory leak by - say, because the reference will be replaced the next time make drag and drop is used, however, my view that preclude any garbage collection, causing an unacceptable peak memory.

    Here is an example which illustrates the problem (app default AIR using Flex 4.5.1):

    Main.MXML

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:local="*"
                                                         xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" width="800"
                                                         height="600">
    
    
              <fx:Script>
                        <![CDATA[
                                  protected function start_clickHandler(event:MouseEvent):void
                                  {
                                            var element:ListGroup = new ListGroup();
                                            this.panel.addElement(element);
                                  }
    
                                  protected function stop_clickHandler(event:MouseEvent):void
                                  {
                                            this.panel.removeAllElements();
                                  }
                        ]]>
              </fx:Script>
    
    
              <s:Panel id="panel" top="100" left="100" bottom="100" right="100" title="Drag Drop Test">
                        <s:controlBarContent>
                                  <s:Button label="Start" click="start_clickHandler(event)" />
                                  <s:Button label="Clear" click="stop_clickHandler(event)" />
                        </s:controlBarContent>
              </s:Panel>
    
    
    </s:WindowedApplication>
    
    

    ListGroup.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"
                         xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%">
              <s:layout>
                        <s:HorizontalLayout />
              </s:layout>
              <s:List id="sourceList" width="100%" height="100%" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true">
                        <s:dataProvider>
                                  <s:ArrayCollection>
                                            <fx:String>Item 1</fx:String>
                                            <fx:String>Item 2</fx:String>
                                            <fx:String>Item 3</fx:String>
                                            <fx:String>Item 4</fx:String>
                                  </s:ArrayCollection>
                        </s:dataProvider>
              </s:List>
              <s:List id="targetList" width="100%" height="100%" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true">
              </s:List>
    </s:Group>
    
    

    If you drag items to the list on the right, there is always at least one instance of ListGroup stuck in memory for the duration of execution (as seen in the profiler).

    Is there a way to perform cleanup on the DragManager (or in fact the underlying DragManagerImpl) upward to a time of my choosing? Thoughts or ideas will be greatly appreciated!

    Thanks a lot for your time!

    I think I'd be monkey-patch NativeDragManagerImpl.  And create a bug report.

  • Garbage Collection, external swf and XML

    I did tons of research on the AS3 garbage collection. I have a decent knowledge of it, but I CAN'T find any info about the deletion of xml data. The worst thing is, I have no control over the version of the file (AS2 or AS3) swf file I'm loading. Unfortunately, I'm loading AS2 swf (with an outside provider that will not show you any code) in a film of AS3. When I run garbage collection, the data from the xml file / is not deleted and I can't understand how get rid of it. The problem is, once a file is loaded which calls an xml file, no other files cannot load an xml.

    If anyone knows how to clear the XML, please fill me in.

    Thank you!

    Heather

    The code is:

    **************UPDATE*************************************

    Hey people,

    Good news. I just read an announcement of Grant Skinner regarding what my problems were.

    For more details, go to his blog @ http://www.gskinner.com/blog/archives/2008/07/unloadandstop_i.html

    Be sure to read the update as well.

    See you soon,.

    Heather

  • My iTunes is a collection of songs with the same artist, the same album artist and the same album separately. How can I fix it?

    Can someone tell me how to solve this problem? I put a lot of effort in organizing my collection and I hate to see 15 sections 'Lil Wayne' in my artist entry or right of the complete discography of Paul McCartney by Paul McCartney with 1 song. I tried to edit all the files together, intentionally misspelling the name and spelling then it right once again, but it do not work and that the use of work well, but it doesn't seem to work.

    If iTunes displays multiple instances of an artist or an album then generally what works is to select all the associated tracks and use read information to add say end X for each of the areas that the slopes have in common:

    • For an album. Album, artist of the Album and artist (if the artist is the same for all tracks) *.
    • For an artist; Album artist (artist and unless there is the comments/featured artists listed that should not be changed)

    Apply the change which merges things together, then remove the excess characters. Occasionally, it can help to close and reopen iTunes between two renaming operations. Part of a compilation should also be set in a consistent manner.

    * If the titles must be synchronized to a non - iOS device, there should be a common artist and/or album must be defined as a Compilation.

    Use the view of songs and display fields, Album, genre, Album, Album artist, genre artist Album, artist and genre artist side by side to see you whether or not it is necessary to change the artist and if sorting values could be the cause of additional problems. See grouping in albums, titles for help if necessary.

    Another tip duplicates stubborn reality. At one point, I had three batches of various artists in the view of artists in my iTunes game library that wouldn't meet usual backward X treatment. What I found worked was adding the final X, but with each group, iTunes wanted to separate start typing a value and let iTunes autocomplete of the Var... for various artists. Collection of AutoComplete lists seemed to work when the full value of collage/montage does not.

    TT2

  • I'm trying to uninstall Cs6 master collection and I can't because this information is displayed ERROR: DW040: the product '{E8AD3069-9EB7-4BA8-8BFE-83F4E69355C0}' is not installed. Cannot proceed with the uninstall. How can I solve this problem?

    I'm trying to uninstall Cs6 master collection and I can't because this information is displayed ERROR: DW040: the product '{E8AD3069-9EB7-4BA8-8BFE-83F4E69355C0}' is not installed. Cannot proceed with the uninstall. How can I solve this problem?

    Hi Paulov53532347,

    Try to use the cleanup for the same tool: use of the Adobe Creative Cloud cleaning tool to solve installation problems

    Let us know if that helps.

  • I synced with my Iphone 6 various collections and works very well. Question: is there a way to get out of the photos from my phone to TV via Apple TV? Camera does this but not Lightroom app.

    I synced with my Iphone 6 various collections and works very well. Question: is there a way to get out of the photos from my phone to TV via Apple TV? Camera does this but not the App mobile Lightroom Dave

    Hello

    There is no feature that can do this in Lightroom Mobile from now.

    You can post your comments/idea here Photoshop community customer family

    Thank you

  • Basic authentication with the RESTful WEb service and a Web Service reference

    Hi all

    We have made significant progress on getting an application to work with RESTful web services, but are now trying to understand how to lock a RESTful Web service while making it available for a particular application.

    We use one of the 'emp' table sample web services come with Apex 4.2 and are trying to apply the Basic Auth to the WEb Service using Weblogic filter defined in the web.xml file. Which works very well. I now get challenged when I try to go to:

    https://wlogic.edu/Apex/BNR/ACE/HR/empinfo/

    And when I authenticate this challenge, I am able to get the data. (we are usiing the Weblogic-level LDAP authentication)

    However, I'm not sure how to get even basic authentication to work with Web Service reference in my application. I see the error message in the application when I try to call this Web Service:

    401 Unauthorized <

    And I see:
    "The request requires user authentication. It MUST contain a header field WWW-Authenticate (section 14.46) containing a fault that is applicable to the requested resource. The client MAY repeat the request with a suitable authorization (section 14.8) header field. If the request already includes identification of the authorization information»

    How can I provide the credentials in the Web reference or provide credentials in the Application?
    Web service works fine if I remove the auth basic RESTful web service in the Web.xml file.

    We should NOT use basic auth and auth Weblogic web service definition basic RESTful Workspace use instead. If so, how would we implement THIS basic authentication in the definition of Web Service and the Web SErvice reference on the application?

    Thank you
    Pat

    Hello Scott,

    Thank you. There is a function for rest in the package:

    function make_rest_request(
    --
    -- This function invokes a RESTful Web service with the supplied name value pairs, body clob, or body blob
    -- the response as an clob.
    --
    -- Arguments:
    --   p_url                  The url endpoint of the Web service
    --   p_http_method          The HTTP Method to use, PUT, POST, GET, HEAD or DELETE
    --   p_username             The username if basic authentication is required for this service
    --   p_password             The password if basic authentication is required for this service
    --   p_proxy_override       The proxy to use for the request
    --   p_body                 The HTTP payload to be sent as clob
    --   p_body_blob            The HTTP payload to be sent as binary blob (ex., posting a file)
    --   p_parm_name            The name of the parameters to be used in name/value pairs
    --   p_parm_value           The value of the paramters to be used in name/value pairs
    --   p_wallet_path          The filesystem path to a wallet if request is https
    --                          ex., file:/usr/home/oracle/WALLETS
    --   p_wallet_pwd           The password to access the wallet
    --
        p_url               in varchar2,
        p_http_method       in varchar2,
        p_username          in varchar2 default null,
        p_password          in varchar2 default null,
        p_proxy_override    in varchar2 default null,
        p_transfer_timeout  in number default 180,
        p_body              in clob default empty_clob(),
        p_body_blob         in blob default empty_blob(),
        p_parm_name         in wwv_flow_global.vc_arr2 default empty_vc_arr,
        p_parm_value        in wwv_flow_global.vc_arr2 default empty_vc_arr,
        p_wallet_path       in varchar2 default null,
        p_wallet_pwd        in varchar2 default null ) return clob;
    

    My point was that using the API makes things easier if you have to look for a solution.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Delete / external swf or the files in the flash file main to unload and load a new swf file and memory garbage collection.

    I can't delete / unload the example swf files external when the carousel.swf (portfolio) appears and press the button about the content overlaps the carousel (portfolio). How can I delete / unload an external swf file in the main flash file and load a SWF, so that at the same time remove garbage collection memory operation?

    This is the error messages I receive: "TypeError: Error #2007: child parameter must be non null.»

    at flash.display::DisplayObjectContainer/removeChild()

    " to index_fla::MainTimeline/Down3().

    Import nl.demonsters.debugger.MonsterDebugger;

    var d: MonsterDebugger = new MonsterDebugger (this);

    stage.scaleMode = StageScaleMode.NO_SCALE;

    internship. Align = StageAlign.TOP_LEFT;

    stage.addEventListener (Event.RESIZE, resizeHandler);

    is the charger for the portfolio page swf

    var loader: Loader;

    var loader2:Loader;

    var loader3:Loader;

    var loader1:Loader;

    resize the content

    function resizeHandler(event:Event):void {}

    resizes the portfolio page to Center

    Loader.x = (stage.stageWidth - loader.width) *. 5;

    Loader.y = (stage.stageHeight - loader.height) *. 5;

    resizes on page to Center

    loader3.x = (stage.stageWidth - 482) *.5 - 260;

    loader3.y = (stage.stageHeight - 492) *.5 - 140;

    * loader2.x = (stage.stageWidth - 658.65) *. 5;

    loader2.y = (stage.stageHeight - 551.45) *. 5; * /

    }

    addEventListener (Event.ENTER_FRAME, onEnterFrame, false, 0, true);

    function onEnterFrame(ev:Event):void {}

    var requesterb:URLRequest = new URLRequest ("carouselLoader.swf");

    Charger = null;

    loader = new Loader();

    Loader.Name = "carousel1.

    Adds gallery.swf in the scene at the beginning of the film

    loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    Loader.Load (requesterb);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader);

    Loader.x = (stage.stageWidth - 739) *. 5;

    Loader.y = (stage.stageHeight - 500) *. 5;

    stopover gallery.swf duplication and more on enter frame

    removeEventListener (Event.ENTER_FRAME, onEnterFrame);

    }

    PORTFOLIO BUTTON

    Add eventlistner so that gallery.swf can be loaded

    MovieClip (root),.nav.portfolio.addEventListener (MouseEvent.MOUSE_DOWN, down, false, 0, true);

    function Down(event:MouseEvent):void {}

    Re add listener for contact.swf and about.swf

    MovieClip (root).nav.info.addEventListener (MouseEvent.MOUSE_DOWN, Down1, false, 0, true);

    MovieClip (root).nav.about.addEventListener (MouseEvent.MOUSE_DOWN, Down3, false, 0, true);

    discharge of entry gallery.swf frame if users press portfolio in nav button

    var applicant: URLRequest = new URLRequest ("carouselLoader.swf");

    Charger = null;

    loader = new Loader();

    Loader.Name = "carousel."

    loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    Loader.Load (requester);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader);

    Loader.x = (stage.stageWidth - 739) *. 5;

    Loader.y = (stage.stageHeight - 500) *. 5;

    removeChild (getChildByName ("about"));

    removeChild (getChildByName ("carousel1"));

    delete eventlistner and prevents duplication of the gallery.swf

    MovieClip (root).nav.portfolio.removeEventListener (MouseEvent.MOUSE_DOWN, down);

    }

    INFORMATION BUTTON

    Add eventlistner so that info.swf can be loaded

    MovieClip (root).nav.info.addEventListener (MouseEvent.MOUSE_DOWN, Down1, false, 0, true);

    function Down1(event:MouseEvent):void {}

    This adds the EventListener for portfolio so that the end user can re-post if they wish.

    MovieClip (root),.nav.portfolio.addEventListener (MouseEvent.MOUSE_DOWN, down, false, 0, true);

    MovieClip (root).nav.about.addEventListener (MouseEvent.MOUSE_DOWN, Down3, false, 0, true);

    var applicant: URLRequest = new URLRequest ("contactLoader.swf");

    loader2 = null;

    loader2 = new Loader();

    loader2. Name = "contact".

    loader2.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    loader2. Load (requester);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader2);

    loader2.x = (stage.stageWidth - 658.65) *. 5;

    loader2.y = (stage.stageHeight - 551.45) *. 5;

    delete eventlistner and prevents duplication of the info.swf

    MovieClip (root).nav.info.removeEventListener (MouseEvent.MOUSE_DOWN, Down1);

    }

    ON THE BUTTON

    Add eventlistner so that info.swf can be loaded

    MovieClip (root).nav.about.addEventListener (MouseEvent.MOUSE_DOWN, Down3, false, 0, true);

    function Down3(event:MouseEvent):void {}

    This adds the EventListener for portfolio so that the end user can re-post if they wish.

    MovieClip (root),.nav.portfolio.addEventListener (MouseEvent.MOUSE_DOWN, down, false, 0, true);

    MovieClip (root).nav.info.addEventListener (MouseEvent.MOUSE_DOWN, Down1, false, 0, true);

    var applicant: URLRequest = new URLRequest ("aboutLoader.swf");

    loader3 = null;

    loader3 = new Loader();

    loader3. Name = "a connection"

    loader3.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, ioError);

    function ioError(event:IOErrorEvent):void {}

    trace (Event);

    }

    try {}

    loader3. Load (requester);

    } catch (SecurityError: error) {}

    trace (Error);

    }

    addChild (loader3);

    loader3.x = (stage.stageWidth - 482) *.5 - 260;

    loader3.y = (stage.stageHeight - 492) *.5 - 140;

    removeChild (getChildByName ("carousel"));

    removeChild (getChildByName ("carousel1"));

    delete eventlistner and prevents duplication of the info.swf

    MovieClip (root).nav.about.removeEventListener (MouseEvent.MOUSE_DOWN, Down3);

    }

    Stop();

    You call unload() on objects that you cancelled - where the error.

    You should do something like:

    {if (loader2)}

    loader2. Unload();

    }

    As for the null value passed into the function - null is a default value. In this way, you can call the low past nothing:

    Down()

    Or you can use it as a handler in which case it will be called by the Auditor:

    Down (mouseEventInstnace);

  • Associative array and Garbage Collection

    Hi all
    is there any concept of garbage collection in the use of an associative array?

    When I create an associative object instance is there any provision in oracle to release and drop this object
    in memory after use?

    Thank you
    Charles

    Not sure; Why would you want to?

    Oracle manages this kind of thing very well; It is not something I've ever had to consider, really. Even if Oracle does not clear the memory allocated immediately, I am sure that it is marked as available for reuse.

  • Run garbage collection operation in AIR - iOS app

    Just to be in a bit of a learning curve, develop a Flash application for browser used in a browser and set up with the memory management optimal if all goes well using Flash Professional CS5.5.

    Part of the process is to make sure that the object have no reference pointing of the finger when they are made with so much garbage can clean them.

    Now, I came to the port of the application on iOS for iPad. My question is... Air for iOS, run the garbage collection?

    Thank you

    Mark

    Yes. and you can manually force garbage collection by calling System.GC() If you use Air 3.0

    but try not to rely too much on the gc to solve memory problems... too much to clean up causes a very noticeable lag when running, and it does not work in any foreseeable calendar I can say... If your memory get is too high, your application can be ejected and crash.

    something to keep in mind, recycle and pool objects and varibles as much as you possibly CAN... try using the NEW keyword as little as possible... then all killed during a phase transition or loading followed a system.GC() if the offset is not noticeable.

  • correct use of the weak reference

    If I understand correctly, if I put the weak reference param true in my event listeners I don't need to worry about removing the headphones.  Is this true?

    I'm not really clear which would cause the listener to be set for garbage collection.  I would not have a situation where the listener has been deleted before as I wanted it.

    I think that it is advisable to withdraw the headphones well, theoretically Yes - you do not have _have_ to remove them when you use weak references. The listener is never set for GC using strong ref - you make yourself in this case.

    I got into the habit of always using weak reference and I have yet to run into a situation where a listener is deleted when I don't want it to be. It's something like - when only weak references to an object exist then this object can be that gc would be - otherwise, it will hang out and consume memory.

    Grant Skinner has published a small article on this just now: http://gskinner.com/blog/archives/2006/07/as3_weakly_refe.html

Maybe you are looking for