* 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,10 +806,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
// Reclaim memory, these are unmanaged resources
|
// Reclaim memory, these are unmanaged resources
|
||||||
mapTexture.Dispose();
|
// If we encountered an exception, one or more of these will be null
|
||||||
image.Dispose();
|
if (mapTexture != null)
|
||||||
imgstream.Close();
|
mapTexture.Dispose();
|
||||||
imgstream.Dispose();
|
|
||||||
|
if (image != null)
|
||||||
|
image.Dispose();
|
||||||
|
|
||||||
|
if (imgstream != null)
|
||||||
|
{
|
||||||
|
imgstream.Close();
|
||||||
|
imgstream.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue