transmote speaks…

design + art + code
  • portfolio
  • rss
  • Home
  • About
  • FLARManager: Augmented Reality in Flash
    • FLARManager intro
    • FLARManager documentation
    • FLARManager – donate
    • Inside FLARManager
      • Inside FLARManager: Getting Started
      • Inside FLARManager: 2D Marker Tracking
      • Inside FLARManager: Basic Augmented Reality
      • Inside FLARManager: Loading Collada Models
      • Inside FLARManager: Tracking Engines
      • Inside FLARManager: Customization
      • Inside FLARManager: FLARManager Miscellany
  • Contact

object references in event handlers prevent GC

ericsoco | 2009/03/21 | 2:03 pm

a bug in flash player 9 i came across today while trying to get a swf to unload completely:

https://bugs.adobe.com/jira/browse/FP-1770

if you have a reference to Keyboard or Capabilities (or, probably, a number of other native Classes as well) in an event handler, it will loiter as a pair of Class and Object references when the enclosing swf is unloaded via Loader.unload().

for example:
private function onKeyDown (evt:KeyboardEvent) :void {
    if (evt.keyCode == Keyboard.SPACE) { doStuff(); }
}

must be replaced with:
private function onKeyDown (evt:KeyboardEvent) :void {
    if (evt.keyCode == 32) { doStuff(); }
}

what a pain.

Categories
to do
Tags
actionscript, Capabilities, event handler, flash player, garbage collection, Keyboard, memory
Comments rss
Comments rss
Trackback
Trackback

« FLARManager v0.1 for FP9 elastotron @ great wall of oakland: friday, april 3rd »

2 responses

what about Keyboard.SPACE inside doStuff ()?

makc | 2009/03/22 | 7:37 am

what about Keyboard.SPACE inside doStuff ()?

haven't tested that, but i imagine it's fine. i

ericsoco | 2009/03/22 | 10:46 am

haven’t tested that, but i imagine it’s fine. i think the problem with using it inside the event handler has to do with the way event handlers are stored in EventDispatcher instance queues; for some reason, using something like Keyboard in there keeps the event handler from getting properly removed from the EventDispatcher queue. calls from the event handler are not stored inside the EventDispatcher queue, and should not be an issue.

just a guess.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType

Recent Posts

  • Nest 0.2 – Scenegraph and Event Model for Processing/Java
  • ‘flip’ on the Great Wall
  • FLARManager v1.1 – Augmented Reality in Flash
  • pecha kucha, 2011.01.11
  • Alternativa3D version 7 support, ARToolworks forum

Tags

3d actionscript Add new tag AR as3 augmented reality camera Capabilities clibinit computer vision digital elastic event handler exhibit exploratorium fiducial flar flare flarmanager flartoolkit flash flash player forum garbage collection generative grid interactive Keyboard marker memory mesh mirror natural feature tracking NFT notes papervision presentation reflection slides sputnik to see tracking video video mirror webcam


If FLARManager has helped you out, please help FLARManager!







Serious ADHD Likely!
rss Comments rss design by jide