[osg-users] Image cache and manually release

2010-10-29 Thread Patrice Defond
Hi, I would like to release an image, but there is a cache whose keep my image in memory. Even if i put my ref_ptros::Image to NULL, the image is always in memory. Do you know how i can manually destruct my object but without desactivate Image Cache ? Thank you! Cheers, Patrice

Re: [osg-users] Image cache and manually release

2010-10-29 Thread Sukender
Hi Patrice, You could try things in osgDB::Registry - use expiry time: addEntryToObjectCache(..., timestamp) removeExpiredObjectsInCache() - Or remove all things in cache: clearObjectCache() - Or replace the prvious one: addEntryToObjectCache(filename, [NULL or a dummy object]). Not sure

Re: [osg-users] Image cache and manually release

2010-10-29 Thread Patrice Defond
Thank for your help Sukender. I can't use the methods removeExpiredObjectsInCache and clearObjectCache because the rest of my application need the cache. It is very specific for a module : it loads big images. So i test addEntryToObjectCache. - With NULL in object : OSG make an error (Error

Re: [osg-users] Image cache and manually release

2010-10-29 Thread Sukender
Hi Patrice, Got two ideas : 1. addEntryToObjectCache(filename, new MyDummyEmptyObject()); 2. addEntryToObjectCache(, 0.0001); removeExpiredObjectsInCache();(if and only if this does not interract negatively with the rest of your app). I personnally prefer the first one. If it still

Re: [osg-users] Image cache and manually release

2010-10-29 Thread Patrice Defond
Yep ! Your first solution works perfectly ! Thank a lot ! I find an other solution : when you read a file whith readImageFile(..), you specify a filename and you can give option. And there is an option to not use Image Cache. Thank you ! Patrice -- Read this topic online