kottore / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

Memory leek while swapping material #90

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a plane with a ColorMaterial and add it to the scene
2. change the material of the plane with a BitmapMaterial (for example)
3. look instances in profiler, the ColorMaterial instance is not garbage 
collected

What is the expected output? What do you see instead?
look instances in profiler, the ColorMaterial instance is not garbage collected

What version of the product are you using? On what operating system?
Away3DLite 1.0.3, MBP SnowLeopard 10.6.2

Please provide any additional information below.

I think there is an error in Scene3D.as line 33 (function removeSceneMaterial)

replacing :
 _materialsSceneList[mat._id[_id]] == null; 
by :
_materialsSceneList[mat._id[_id]] = null;

fix the issue.

You can see before.png and after.png (profiler print screen before and after 
the fix).
My work example is located at http://neoia.fr/showcase/CubeViewer/1/.

Away3D rocks ! Thank you guys.

Original issue reported on code.google.com by david.do...@gmail.com on 26 Jan 2010 at 3:43

Attachments:

GoogleCodeExporter commented 8 years ago
sorry it's leak not leek... 

Original comment by david.do...@gmail.com on 26 Jan 2010 at 3:46

GoogleCodeExporter commented 8 years ago
seems to be super-obvious once you point it out. thanks for the research David! 
applying fix and closing issue

Original comment by jens...@gmail.com on 15 Jul 2010 at 10:11