diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-03-05 17:55:33 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-05 17:55:33 -0800 |
commit | 8ad01dd79a2c215895017475bcfd62808f8893be (patch) | |
tree | 04f1bda6d5e291e12e0770377dc0575bf37359d1 /indra | |
parent | f0e6ad509a65c1f888f9af6c3421e7ec024100cb (diff) |
Wrapping all cases of LLPathingLib::getInstance in null pointer checks.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llpathfindingnavmeshzone.cpp | 23 |
2 files changed, 22 insertions, 6 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index eee5d6860d..37bf937cd1 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -265,7 +265,10 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) mNavMeshZoneSlot.disconnect();
}
- //mNavMeshZone.disable();
+ if (LLPathingLib::getInstance() != NULL)
+ {
+ mNavMeshZone.disable();
+ }
LLFloater::onClose(pIsAppQuitting);
setHeartBeat( false );
diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 986acfa3e8..8fa6fc3c8b 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -65,7 +65,10 @@ LLPathfindingNavMeshZone::navmesh_zone_slot_t LLPathfindingNavMeshZone::register void LLPathfindingNavMeshZone::setCurrentRegionAsCenter()
{
llassert(LLPathingLib::getInstance() != NULL);
- LLPathingLib::getInstance()->cleanupResidual();
+ if (LLPathingLib::getInstance() != NULL)
+ {
+ LLPathingLib::getInstance()->cleanupResidual();
+ }
mNavMeshLocations.clear();
LLViewerRegion *currentRegion = gAgent.getRegion();
const LLUUID ¤tRegionUUID = currentRegion->getRegionID();
@@ -91,8 +94,10 @@ void LLPathfindingNavMeshZone::disable() mNavMeshSlot.disconnect();
}
- llassert(LLPathingLib::getInstance() != NULL);
- LLPathingLib::getInstance()->cleanupResidual();
+ if (LLPathingLib::getInstance() != NULL)
+ {
+ LLPathingLib::getInstance()->cleanupResidual();
+ }
mNavMeshLocations.clear();
}
@@ -163,7 +168,11 @@ void LLPathfindingNavMeshZone::updateStatus() else if (hasRequestCompleted)
{
zoneRequestStatus = kNavMeshZoneRequestCompleted;
- LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") );
+ llassert(LLPathingLib::getInstance() != NULL);
+ if (LLPathingLib::getInstance() != NULL)
+ {
+ LLPathingLib::getInstance()->stitchNavMeshes( gSavedSettings.getBOOL("EnableVBOForNavMeshVisualization") );
+ }
}
else
{
@@ -209,7 +218,11 @@ void LLPathfindingNavMeshZone::NavMeshLocation::handleNavMesh(LLPathfindingNavMe llassert(!pNavMeshData.empty());
mHasNavMesh = true;
mNavMeshVersion = pNavMeshVersion;
- LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection);
+ llassert(LLPathingLib::getInstance() != NULL);
+ if (LLPathingLib::getInstance() != NULL)
+ {
+ LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD(pNavMeshData, mDirection);
+ }
}
}
|