Select to view content in your preferred language

Disposing input of Geoprocessor

470
0
08-06-2010 12:51 AM
ShaneDillon
New Contributor
I have been trying to solve this for a few days now and it's driving me nuts!!!! After executing my Clipping method using the Geoprocessor I need to release or dispose of the input as the preceeding method creates the input (featureclass). When I run the tool again the input gets update (same name with different extent through panning to a different location) but the previous input seems to still be cached in memory and is used as the clip input. At the end of each clipping process I have tried several ways to dispose or release the input from memory....

System.Runtime.InteropServices.Marshal.ReleaseComObject(inputFC);
inputFC = null;
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(inputFC);

and forcing a garbage collection...

GC.Collect();
GC.WaitForPendingFinalizers();

No matter what I do, if I then go and open the Clip tool from the Toolbox and look in the input dropdown I still see multiple instances of the input featureclass (the clipping layer as well). If you run the Clip tool from the Toolbox then go and run it again the dropdown boxes only ever display the featureclasses in the TOC. How is the out-of-box Clip tool disposing the inputs in the Geoprocessor/Arcmap.


Shane Dillon| GIS Analyst| |Forest Information and Planning, Forests NSW| Industry & Investment NSW |
357 Harbour Drive, Coffs Harbour NSW 2450
T: 02 6656 8813| F: 02 6651 2909| M: 0429 691 176| E: shaned@sf.nsw.gov.au
W: www.industry.nsw.gov.au | www.dpi.nsw.gov.au
0 Kudos
0 Replies