Shaderregisterelement memory leak - please help

Software: Away3D 4.x

lisophorm, Newbie
Posted: 28 December 2012 05:36 PM   Total Posts: 10

Hi all,

I am totally new to away3d, I am handling a project created by another developer with a previous version of away3d 4.
My project creates and destroys on the fly some custom meshes.
The problem is that the memory usage keep expanding until the system crashes,
I am using the FB profiler. And I notice each time a new mesh is created the number of instances of shaderregisterelement of away3d.materials.compilation increases…
With away3d 4.0 the insances of ShaderRegisterElement where increasing only by 1
With the latest alpha each time a mesh is created I got over 20 new instances of ShaderRegisterElement!

Now what is the correct procedure to dispose a Mesh? I have tried different ways but the instances of ShaderRegisterElement keep increasing.

Can anybody help me with a code sample?

Thanks for any help

A.

   

lisophorm, Newbie
Posted: 28 December 2012 08:34 PM   Total Posts: 10   [ # 1 ]

I found a solution that works on 4.0 but not with the latest beta.
If anyone have some clues I’d be really grateful

This seems to do the trick:
view.scene.removeChild(theMesh);
theMesh.material.dispose();
// geometry connected to the Mesh
tempGeom.dispose();
theMesh.geometry.dispose();
theMesh=null;

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X