diff options
author | UbitUmarov | 2016-11-18 00:12:09 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-18 00:12:09 +0000 |
commit | ba7904a3a80713f726d434fc82e9a80306372e2c (patch) | |
tree | 0686b2c9132db1a2481957fbf9ad98d660d332c5 /OpenSim | |
parent | counting issus safeguard (diff) | |
download | opensim-SC_OLD-ba7904a3a80713f726d434fc82e9a80306372e2c.zip opensim-SC_OLD-ba7904a3a80713f726d434fc82e9a80306372e2c.tar.gz opensim-SC_OLD-ba7904a3a80713f726d434fc82e9a80306372e2c.tar.bz2 opensim-SC_OLD-ba7904a3a80713f726d434fc82e9a80306372e2c.tar.xz |
a few more changes on potencial mem issues
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Capabilities/Caps.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 10 |
3 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs index 3efab8e..5e89c38 100644 --- a/OpenSim/Capabilities/Caps.cs +++ b/OpenSim/Capabilities/Caps.cs | |||
@@ -141,6 +141,11 @@ namespace OpenSim.Framework.Capabilities | |||
141 | m_capsActive.Reset(); | 141 | m_capsActive.Reset(); |
142 | } | 142 | } |
143 | 143 | ||
144 | ~Caps() | ||
145 | { | ||
146 | m_capsActive.Dispose(); | ||
147 | } | ||
148 | |||
144 | /// <summary> | 149 | /// <summary> |
145 | /// Register a handler. This allows modules to register handlers. | 150 | /// Register a handler. This allows modules to register handlers. |
146 | /// </summary> | 151 | /// </summary> |
diff --git a/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs b/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs index 9056548..4ff8cba 100644 --- a/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs +++ b/OpenSim/Framework/DoubleDictionaryThreadAbortSafe.cs | |||
@@ -55,6 +55,11 @@ namespace OpenSim.Framework | |||
55 | Dictionary2 = new Dictionary<TKey2, TValue>(capacity); | 55 | Dictionary2 = new Dictionary<TKey2, TValue>(capacity); |
56 | } | 56 | } |
57 | 57 | ||
58 | ~DoubleDictionaryThreadAbortSafe() | ||
59 | { | ||
60 | rwLock.Dispose(); | ||
61 | } | ||
62 | |||
58 | public void Add(TKey1 key1, TKey2 key2, TValue value) | 63 | public void Add(TKey1 key1, TKey2 key2, TValue value) |
59 | { | 64 | { |
60 | bool gotLock = false; | 65 | bool gotLock = false; |
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 | { |