Fix crash if periodic av metric update happens after disconnect.
This commit is contained in:
@@ -3158,7 +3158,7 @@ void LLAppViewer::requestQuit()
|
|||||||
// Try to send last batch of avatar rez metrics.
|
// Try to send last batch of avatar rez metrics.
|
||||||
if (!gDisconnected && isAgentAvatarValid())
|
if (!gDisconnected && isAgentAvatarValid())
|
||||||
{
|
{
|
||||||
gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent.
|
LLVOAvatarSelf::updateAvatarRezMetrics(true); // force a last packet to be sent.
|
||||||
}
|
}
|
||||||
|
|
||||||
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
|
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ void LLVOAvatarSelf::initInstance()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//doPeriodically(output_self_av_texture_diagnostics, 30.0);
|
//doPeriodically(output_self_av_texture_diagnostics, 30.0);
|
||||||
doPeriodically(boost::bind(&LLVOAvatarSelf::updateAvatarRezMetrics, this, false), 5.0);
|
doPeriodically(boost::bind(&LLVOAvatarSelf::updateAvatarRezMetrics, false), 5.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
@@ -2247,6 +2247,11 @@ private:
|
|||||||
|
|
||||||
bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send)
|
bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send)
|
||||||
{
|
{
|
||||||
|
//Can be called via event system after agent avatar has been removed.
|
||||||
|
//Also skip if quit has been requested, because we already send out rez metrics when entering the quit state.
|
||||||
|
if(!isAgentAvatarValid() || LLAppViewer::instance()->quitRequested())
|
||||||
|
return false;
|
||||||
|
|
||||||
const F32 AV_METRICS_INTERVAL_QA = 30.0;
|
const F32 AV_METRICS_INTERVAL_QA = 30.0;
|
||||||
F32 send_period = 300.0;
|
F32 send_period = 300.0;
|
||||||
if (gSavedSettings.getBOOL("QAModeMetrics"))
|
if (gSavedSettings.getBOOL("QAModeMetrics"))
|
||||||
@@ -2254,13 +2259,13 @@ bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send)
|
|||||||
send_period = AV_METRICS_INTERVAL_QA;
|
send_period = AV_METRICS_INTERVAL_QA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force_send || mTimeSinceLastRezMessage.getElapsedTimeF32() > send_period)
|
if (force_send || gAgentAvatarp->mTimeSinceLastRezMessage.getElapsedTimeF32() > send_period)
|
||||||
{
|
{
|
||||||
// Stats for completed phases have been getting logged as they
|
// Stats for completed phases have been getting l ogged as they
|
||||||
// complete. This will give us stats for any timers that
|
// complete. This will give us stats for any timers that
|
||||||
// haven't finished as of the metric's being sent.
|
// haven't finished as of the metric's being sent.
|
||||||
LLVOAvatar::logPendingPhasesAllAvatars();
|
LLVOAvatar::logPendingPhasesAllAvatars();
|
||||||
sendViewerAppearanceChangeMetrics();
|
gAgentAvatarp->sendViewerAppearanceChangeMetrics();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
LLTimer mTimeSinceLastRezMessage;
|
LLTimer mTimeSinceLastRezMessage;
|
||||||
bool updateAvatarRezMetrics(bool force_send);
|
static bool updateAvatarRezMetrics(bool force_send);
|
||||||
|
|
||||||
std::vector<LLSD> mPendingTimerRecords;
|
std::vector<LLSD> mPendingTimerRecords;
|
||||||
void addMetricsTimerRecord(const LLSD& record);
|
void addMetricsTimerRecord(const LLSD& record);
|
||||||
|
|||||||
Reference in New Issue
Block a user