diff options
author | UbitUmarov | 2012-08-06 09:06:46 +0100 |
---|---|---|
committer | UbitUmarov | 2012-08-06 09:06:46 +0100 |
commit | 36a1248b317cd80717fef6bc7c8fab318172a075 (patch) | |
tree | c81fc363cfc52d9b3faec5ccb0693f2173650bc0 /OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |
parent | bug fix: keep sculpt bitmaps border pixels during resolution scaling. (diff) | |
download | opensim-SC_OLD-36a1248b317cd80717fef6bc7c8fab318172a075.zip opensim-SC_OLD-36a1248b317cd80717fef6bc7c8fab318172a075.tar.gz opensim-SC_OLD-36a1248b317cd80717fef6bc7c8fab318172a075.tar.bz2 opensim-SC_OLD-36a1248b317cd80717fef6bc7c8fab318172a075.tar.xz |
** DANGER someone should stress test more ** release unused physics meshs, including unmanaged memory allocations (allocated by managed code)
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index a3534a4..fbc6134 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -57,7 +57,6 @@ using OdeAPI; | |||
57 | using OpenSim.Framework; | 57 | using OpenSim.Framework; |
58 | using OpenSim.Region.Physics.Manager; | 58 | using OpenSim.Region.Physics.Manager; |
59 | 59 | ||
60 | |||
61 | namespace OpenSim.Region.Physics.OdePlugin | 60 | namespace OpenSim.Region.Physics.OdePlugin |
62 | { | 61 | { |
63 | public class OdePrim : PhysicsActor | 62 | public class OdePrim : PhysicsActor |
@@ -538,24 +537,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
538 | { | 537 | { |
539 | set | 538 | set |
540 | { | 539 | { |
541 | /* | ||
542 | IMesh mesh = null; | ||
543 | if (_parent_scene.needsMeshing(value)) | ||
544 | { | ||
545 | bool convex; | ||
546 | if (m_shapetype == 0) | ||
547 | convex = false; | ||
548 | else | ||
549 | convex = true; | ||
550 | mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, (int)LevelOfDetail.High, true, convex); | ||
551 | } | ||
552 | |||
553 | if (mesh != null) | ||
554 | { | ||
555 | lock (m_meshlock) | ||
556 | m_mesh = mesh; | ||
557 | } | ||
558 | */ | ||
559 | AddChange(changes.Shape, value); | 540 | AddChange(changes.Shape, value); |
560 | } | 541 | } |
561 | } | 542 | } |
@@ -1357,7 +1338,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1357 | 1338 | ||
1358 | IMesh mesh = null; | 1339 | IMesh mesh = null; |
1359 | 1340 | ||
1360 | |||
1361 | lock (m_meshlock) | 1341 | lock (m_meshlock) |
1362 | { | 1342 | { |
1363 | if (m_mesh == null) | 1343 | if (m_mesh == null) |
@@ -1403,7 +1383,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1403 | hasOOBoffsetFromMesh = true; | 1383 | hasOOBoffsetFromMesh = true; |
1404 | 1384 | ||
1405 | mesh.releaseSourceMeshData(); | 1385 | mesh.releaseSourceMeshData(); |
1406 | m_mesh = null; | 1386 | m_mesh = mesh; |
1407 | } | 1387 | } |
1408 | 1388 | ||
1409 | IntPtr geo = IntPtr.Zero; | 1389 | IntPtr geo = IntPtr.Zero; |
@@ -1545,7 +1525,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1545 | d.GeomTriMeshDataDestroy(_triMeshData); | 1525 | d.GeomTriMeshDataDestroy(_triMeshData); |
1546 | _triMeshData = IntPtr.Zero; | 1526 | _triMeshData = IntPtr.Zero; |
1547 | } | 1527 | } |
1528 | |||
1548 | } | 1529 | } |
1530 | |||
1531 | |||
1549 | // catch (System.AccessViolationException) | 1532 | // catch (System.AccessViolationException) |
1550 | catch (Exception e) | 1533 | catch (Exception e) |
1551 | { | 1534 | { |
@@ -1559,6 +1542,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1559 | { | 1542 | { |
1560 | m_log.ErrorFormat("[PHYSICS]: PrimGeom destruction BAD {0}", Name); | 1543 | m_log.ErrorFormat("[PHYSICS]: PrimGeom destruction BAD {0}", Name); |
1561 | } | 1544 | } |
1545 | |||
1546 | if (m_mesh != null) | ||
1547 | { | ||
1548 | _parent_scene.mesher.ReleaseMesh(m_mesh); | ||
1549 | m_mesh = null; | ||
1550 | } | ||
1551 | |||
1562 | Body = IntPtr.Zero; | 1552 | Body = IntPtr.Zero; |
1563 | hasOOBoffsetFromMesh = false; | 1553 | hasOOBoffsetFromMesh = false; |
1564 | } | 1554 | } |