mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
* 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 #3848
This commit is contained in:
@@ -806,10 +806,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
finally
|
||||
{
|
||||
// Reclaim memory, these are unmanaged resources
|
||||
mapTexture.Dispose();
|
||||
image.Dispose();
|
||||
imgstream.Close();
|
||||
imgstream.Dispose();
|
||||
// If we encountered an exception, one or more of these will be null
|
||||
if (mapTexture != null)
|
||||
mapTexture.Dispose();
|
||||
|
||||
if (image != null)
|
||||
image.Dispose();
|
||||
|
||||
if (imgstream != null)
|
||||
{
|
||||
imgstream.Close();
|
||||
imgstream.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user