* If the world map module encounters an error, not all of the objects will be created and will therefore be null in the finally clause. Therefore, only dispose of objects that are not null in the finally clause.
* fixes mantis #3848trunk
parent
eb1a6e9b87
commit
b6caf1606d
|
@ -806,12 +806,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
// Reclaim memory, these are unmanaged resources
|
// Reclaim memory, these are unmanaged resources
|
||||||
|
// If we encountered an exception, one or more of these will be null
|
||||||
|
if (mapTexture != null)
|
||||||
mapTexture.Dispose();
|
mapTexture.Dispose();
|
||||||
|
|
||||||
|
if (image != null)
|
||||||
image.Dispose();
|
image.Dispose();
|
||||||
|
|
||||||
|
if (imgstream != null)
|
||||||
|
{
|
||||||
imgstream.Close();
|
imgstream.Close();
|
||||||
imgstream.Dispose();
|
imgstream.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use cached version so we don't have to loose our mind
|
// Use cached version so we don't have to loose our mind
|
||||||
|
|
Loading…
Reference in New Issue