aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs
index 98c2e71..2ae0881 100644
--- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs
+++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs
@@ -1483,6 +1483,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
1483 1483
1484 lock (diskLock) 1484 lock (diskLock)
1485 { 1485 {
1486 Stream stream = null;
1486 try 1487 try
1487 { 1488 {
1488 if (!Directory.Exists(dir)) 1489 if (!Directory.Exists(dir))
@@ -1490,8 +1491,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
1490 Directory.CreateDirectory(dir); 1491 Directory.CreateDirectory(dir);
1491 } 1492 }
1492 1493
1493 using(Stream stream = File.Open(filename, FileMode.Create)) 1494 stream = File.Open(filename, FileMode.Create);
1494 ok = mesh.ToStream(stream); 1495 ok = mesh.ToStream(stream);
1495 } 1496 }
1496 catch (IOException e) 1497 catch (IOException e)
1497 { 1498 {
@@ -1500,6 +1501,11 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
1500 filename, e.Message, e.StackTrace); 1501 filename, e.Message, e.StackTrace);
1501 ok = false; 1502 ok = false;
1502 } 1503 }
1504 finally
1505 {
1506 if(stream != null)
1507 stream.Dispose();
1508 }
1503 1509
1504 if (!ok && File.Exists(filename)) 1510 if (!ok && File.Exists(filename))
1505 { 1511 {