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
0.7.4.1
Justin Clark-Casey (justincc) 2012-04-20 23:35:11 +01:00
parent 566327a948
commit c8307cdf1e
1 changed files with 7 additions and 4 deletions

View File

@ -139,8 +139,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
string tempName = Path.GetTempFileName(); string tempName = Path.GetTempFileName();
Bitmap existingBitmap = null; Bitmap existingBitmap = null;
Bitmap thisBitmap; Bitmap thisBitmap = null;
Bitmap newBitmap; Bitmap newBitmap = null;
try try
{ {
@ -176,7 +176,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
if (existingBitmap != null) if (existingBitmap != null)
existingBitmap.Dispose(); existingBitmap.Dispose();
if (thisBitmap != null)
thisBitmap.Dispose(); thisBitmap.Dispose();
if (newBitmap != null)
newBitmap.Dispose(); newBitmap.Dispose();
if (File.Exists(tempName)) if (File.Exists(tempName))