ThinkGeo.com    |     Documentation    |     Premium Support

Safe FeatureSource.Open() at load event

Hi Team,

Its right to set FeatureSource.Open() at winform load event???

regards,
Tamilarasan.

Hi Tamilarasan,

I don’t know what’s the meaning of safe, you can open the feature source before where you need to use related function and close them after you used it.

If hadn’t open the feature source, the exception will thrown and you can modify your code.

Regards,

Ethan

Hi Ethan,

Feature source concurrently access in background thread in case simultaneously two thread doing at a time one thread close the feature source it will throw exception.

So we need to open always, it will cause any performance issue or not?.

Regards,
Tamilarasan.

Hi Tamilarasan,

I understand that now.

You can keep open the data, in fact for shape file we always don’t close it until program is closed.

But if your project need to open too many shapes or some raster data, which maybe cause memory leak, you should want to close some of them when you make sure the data won’t be used.

Regards,

Ethan