Zero out PrimitiveBaseShape.SculptData after the JPEG2000 data has been decoded to allow garbage collection on it

prioritization
John Hurliman 2009-10-18 02:53:36 -07:00
parent b4526a5a6d
commit 2f2eeb6731
1 changed files with 3 additions and 0 deletions

View File

@ -289,6 +289,9 @@ namespace OpenSim.Region.Physics.Meshing
ManagedImage managedImage; // we never use this ManagedImage managedImage; // we never use this
OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata); OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata);
// Remove the reference to the encoded JPEG2000 data so it can be GCed
primShape.SculptData = Utils.EmptyBytes;
if (cacheSculptMaps) if (cacheSculptMaps)
{ {
try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); }