Do not destruct running Responders upon viewer exit.
This hopefully saves some crashes.
This commit is contained in:
@@ -308,6 +308,7 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
virtual void abort_impl(void) { }
|
virtual void abort_impl(void) { }
|
||||||
virtual void finish_impl(void) { }
|
virtual void finish_impl(void) { }
|
||||||
virtual char const* state_str_impl(state_type run_state) const = 0;
|
virtual char const* state_str_impl(state_type run_state) const = 0;
|
||||||
|
virtual void force_killed(void); // Called from AIEngine::flush().
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reset(void); // Called from run() to (re)initialize a (re)start.
|
void reset(void); // Called from run() to (re)initialize a (re)start.
|
||||||
@@ -324,7 +325,6 @@ class AIStateMachine : public LLThreadSafeRefCount
|
|||||||
mSleep = 0;
|
mSleep = 0;
|
||||||
return mSleep != 0;
|
return mSleep != 0;
|
||||||
}
|
}
|
||||||
void force_killed(void); // Called from AIEngine::flush().
|
|
||||||
|
|
||||||
friend class AIEngine; // Calls multiplex() and force_killed().
|
friend class AIEngine; // Calls multiplex() and force_killed().
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -146,6 +146,18 @@ void LLURLRequest::initialize_impl(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLURLRequest::force_killed(void)
|
||||||
|
{
|
||||||
|
// Avoid destructing the responder, if any, because that might
|
||||||
|
// execute code that might crash now that the viewer is exiting.
|
||||||
|
if (mResponder)
|
||||||
|
{
|
||||||
|
intrusive_ptr_add_ref(mResponder.get());
|
||||||
|
}
|
||||||
|
// Call base class.
|
||||||
|
AIStateMachine::force_killed();
|
||||||
|
}
|
||||||
|
|
||||||
void LLURLRequest::addHeader(const char* header)
|
void LLURLRequest::addHeader(const char* header)
|
||||||
{
|
{
|
||||||
AICurlEasyRequest_wat curlEasyRequest_w(*mCurlEasyRequest);
|
AICurlEasyRequest_wat curlEasyRequest_w(*mCurlEasyRequest);
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ class LLURLRequest : public AICurlEasyRequestStateMachine {
|
|||||||
protected:
|
protected:
|
||||||
// Handle initializing the object.
|
// Handle initializing the object.
|
||||||
/*virtual*/ void initialize_impl(void);
|
/*virtual*/ void initialize_impl(void);
|
||||||
|
|
||||||
|
// Called when statemachine was flushed (and killed) at viewer exit.
|
||||||
|
/*virtual*/ void force_killed(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LL_LLURLREQUEST_H
|
#endif // LL_LLURLREQUEST_H
|
||||||
|
|||||||
Reference in New Issue
Block a user