Commits

Anonymous committed d9381c8

Another attempt at fixing unit test, this one is weirder.
Don't schedule the queue timer in the tick() of the retry timer.
Instead, schedule it in the RetryTimer's destructor.
This is an artifact of how the LLEventTimer's loop is handled.

  • Participants
  • Parent commits d84bbcf

Comments (0)

Files changed (1)

indra/newview/llmediadataclient.cpp

 LLMediaDataClient::Responder::RetryTimer::~RetryTimer() 
 {
 	LL_DEBUGS("LLMediaDataClient") << "~RetryTimer" << *(mResponder->getRequest()) << LL_ENDL;
+
+	// XXX This is weird: Instead of doing the work in tick()  (which re-schedules
+	// a timer, which might be risky), do it here, in the destructor.  Yes, it is very odd.
+	// Instead of retrying, we just put the request back onto the queue
+	LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *(mResponder->getRequest()) << "retrying" << LL_ENDL;
+	mResponder->getRequest()->reEnqueue();
+
+	// Release the ref to the responder.
 	mResponder = NULL;
 }
 
 // virtual
 BOOL LLMediaDataClient::Responder::RetryTimer::tick()
 {
-	// Instead of retrying, we just put the request back onto the queue
-	LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *(mResponder->getRequest()) << "retrying" << LL_ENDL;
-	mResponder->getRequest()->reEnqueue();
 	// Don't fire again
 	return TRUE;
 }