diff options
author | Teravus Ovares | 2009-07-17 21:13:50 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-07-17 21:13:50 +0000 |
commit | b6caf1606dfa35d843f567f8b9c33f54fa3581e5 (patch) | |
tree | ee2e5c836901297076df1871a371d789a29819cd | |
parent | * Patch from otakup0pe to help freeswitch play nice with complex existing fre... (diff) | |
download | opensim-SC_OLD-b6caf1606dfa35d843f567f8b9c33f54fa3581e5.zip opensim-SC_OLD-b6caf1606dfa35d843f567f8b9c33f54fa3581e5.tar.gz opensim-SC_OLD-b6caf1606dfa35d843f567f8b9c33f54fa3581e5.tar.bz2 opensim-SC_OLD-b6caf1606dfa35d843f567f8b9c33f54fa3581e5.tar.xz |
* 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
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 1c7baa2..3f640c5 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -806,10 +806,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
806 | finally | 806 | finally |
807 | { | 807 | { |
808 | // Reclaim memory, these are unmanaged resources | 808 | // Reclaim memory, these are unmanaged resources |
809 | mapTexture.Dispose(); | 809 | // If we encountered an exception, one or more of these will be null |
810 | image.Dispose(); | 810 | if (mapTexture != null) |
811 | imgstream.Close(); | 811 | mapTexture.Dispose(); |
812 | imgstream.Dispose(); | 812 | |
813 | if (image != null) | ||
814 | image.Dispose(); | ||
815 | |||
816 | if (imgstream != null) | ||
817 | { | ||
818 | imgstream.Close(); | ||
819 | imgstream.Dispose(); | ||
820 | } | ||
813 | } | 821 | } |
814 | } | 822 | } |
815 | else | 823 | else |