Papervision3d GW Memory Leak
Yesterday I came across a nasty leak with GW, it just wouldn't kill my moviematerials after I removed all the references to them, I tried it all, removeChild, removeListener, weak keys... you name it.
So I finally decided to go have a look at Papervision's destroy methods, and surprise surprise they weren't being called, no harm there, it's alpha these things are meant to happen
So here's what you have to do to force those destroy methods to execute, and clean your memory.
In org.papervision3d.core.proto.MaterialObject3D set the destroy method from protected to public, do the same to all the materials that you use, like org.papervision3d.materials.MovieMaterial . When you're done with these just the destroy method in your class. For me it looks something like this:
Hope this helps.
February 28th, 2008 at 3:16 am
Have you tried just setting material.animated = false; before removing… it solved my leaks for MovieMaterials
February 28th, 2008 at 8:40 am
May 17th, 2008 at 4:34 am
Hey,
i had a few of these gc problems with pv3d as well.
In some cases PV3D keeps very strong reference
Did you put it in the PaperVision-IssueTracking on google Code?
May 17th, 2008 at 8:04 am
No I didn’t but I spoke with Ralph and think the latest rev has this correction.
June 25th, 2008 at 9:12 am
Hi guys, I´m trying to delete objects as you said but when I request the scene numChildren it´s giving me the same amount of objects than before destroying them, any ideas?
I ´d really appreciate any comments
Thx!
June 25th, 2008 at 9:23 am
June 26th, 2008 at 7:43 am
Idoru thx, but it didn´t work at all, how do you use to remove the objects from the scene? A piece of code would be very appreciate.
June 26th, 2008 at 8:02 am
scene.removeChild(myDo3d);
June 26th, 2008 at 10:34 am
^^ ok!
But the problem is that.. even the objects dissapear from the scene, they´re still there!! I mean, if you´re creating and deleting Planes for a while the scene.numChildren will grow up until the program crash!:P I need a way to create and delete objects for real,
any ideas? Am I wrong about at any Point? thx !
June 26th, 2008 at 10:58 am
Hey! :__ Finally I did it! My code was right but I had a wrong Papervision2 package version!
I´m doing a simple Arcade game andI will show u when I finish 
Thx guys :$ you really help me out
best regards!
July 2nd, 2008 at 6:50 pm
Cool I’, glad you managed to solve it, and looking forward to seeing your work