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=59730.7.4.1
parent
566327a948
commit
c8307cdf1e
|
@ -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,8 +176,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
if (existingBitmap != null)
|
if (existingBitmap != null)
|
||||||
existingBitmap.Dispose();
|
existingBitmap.Dispose();
|
||||||
|
|
||||||
thisBitmap.Dispose();
|
if (thisBitmap != null)
|
||||||
newBitmap.Dispose();
|
thisBitmap.Dispose();
|
||||||
|
|
||||||
|
if (newBitmap != null)
|
||||||
|
newBitmap.Dispose();
|
||||||
|
|
||||||
if (File.Exists(tempName))
|
if (File.Exists(tempName))
|
||||||
File.Delete(tempName);
|
File.Delete(tempName);
|
||||||
|
|
Loading…
Reference in New Issue