diff options
author | Justin Clark-Casey (justincc) | 2012-04-20 23:35:11 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-20 23:35:11 +0100 |
commit | c8307cdf1e1f06f68fdf3f36d1facd295c77e88d (patch) | |
tree | 19eeb1a4814759e0cc97e30c0afd4d3b79c42cf4 | |
parent | If a physical prim is manually moved (e.g. by a user) then set the geometry p... (diff) | |
download | opensim-SC-c8307cdf1e1f06f68fdf3f36d1facd295c77e88d.zip opensim-SC-c8307cdf1e1f06f68fdf3f36d1facd295c77e88d.tar.gz opensim-SC-c8307cdf1e1f06f68fdf3f36d1facd295c77e88d.tar.bz2 opensim-SC-c8307cdf1e1f06f68fdf3f36d1facd295c77e88d.tar.xz |
Improve bitmap disposal to do null checks and not to potentially try disposal of uninitialized variables.
This issue doesn't cause the mono 2.10.5 compiler to fail but appears to cause the windows compiler to fail.
Resolves http://opensimulator.org/mantis/view.php?id=5973
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 039c3fa..d78ade5 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -139,8 +139,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
139 | string tempName = Path.GetTempFileName(); | 139 | string tempName = Path.GetTempFileName(); |
140 | 140 | ||
141 | Bitmap existingBitmap = null; | 141 | Bitmap existingBitmap = null; |
142 | Bitmap thisBitmap; | 142 | Bitmap thisBitmap = null; |
143 | Bitmap newBitmap; | 143 | Bitmap newBitmap = null; |
144 | 144 | ||
145 | try | 145 | try |
146 | { | 146 | { |
@@ -176,8 +176,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
176 | if (existingBitmap != null) | 176 | if (existingBitmap != null) |
177 | existingBitmap.Dispose(); | 177 | existingBitmap.Dispose(); |
178 | 178 | ||
179 | thisBitmap.Dispose(); | 179 | if (thisBitmap != null) |
180 | newBitmap.Dispose(); | 180 | thisBitmap.Dispose(); |
181 | |||
182 | if (newBitmap != null) | ||
183 | newBitmap.Dispose(); | ||
181 | 184 | ||
182 | if (File.Exists(tempName)) | 185 | if (File.Exists(tempName)) |
183 | File.Delete(tempName); | 186 | File.Delete(tempName); |