mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 03:15:41 +08:00
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
This commit is contained in:
@@ -139,8 +139,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||
string tempName = Path.GetTempFileName();
|
||||
|
||||
Bitmap existingBitmap = null;
|
||||
Bitmap thisBitmap;
|
||||
Bitmap newBitmap;
|
||||
Bitmap thisBitmap = null;
|
||||
Bitmap newBitmap = null;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -176,8 +176,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||
if (existingBitmap != null)
|
||||
existingBitmap.Dispose();
|
||||
|
||||
thisBitmap.Dispose();
|
||||
newBitmap.Dispose();
|
||||
if (thisBitmap != null)
|
||||
thisBitmap.Dispose();
|
||||
|
||||
if (newBitmap != null)
|
||||
newBitmap.Dispose();
|
||||
|
||||
if (File.Exists(tempName))
|
||||
File.Delete(tempName);
|
||||
|
||||
Reference in New Issue
Block a user