From 8ad01dd79a2c215895017475bcfd62808f8893be Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 5 Mar 2012 17:55:33 -0800 Subject: Wrapping all cases of LLPathingLib::getInstance in null pointer checks. --- indra/newview/llfloaterpathfindingconsole.cpp | 5 ++++- indra/newview/llpathfindingnavmeshzone.cpp | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'indra/newview') 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); + } } } -- cgit v1.2.3