Backed out changeset 947e044fa5f1 (Crash fix in LLEventPollImpl) for fix from Linden Lab

Ansariel 2016-07-26 10:17:17 +02:00
parent 75abd53121
commit 3239139709
2 changed files with 12 additions and 43 deletions

View File

@ -52,11 +52,7 @@ namespace Details
public:
LLEventPollImpl(const LLHost &sender);
// <FS:ND> FIRE-19557; Hold on to LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// void start(const std::string &url);
void start( const std::string &url, boost::shared_ptr< LLEventPollImpl > aThis );
// </FS:ND>
void start(const std::string &url);
void stop();
private:
@ -67,10 +63,7 @@ namespace Details
static const F32 EVENT_POLL_ERROR_RETRY_SECONDS_INC;
static const S32 MAX_EVENT_POLL_HTTP_ERRORS;
// <FS:ND> FIRE-19557; Hold on to LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// void eventPollCoro(std::string url);
void eventPollCoro( std::string url, boost::shared_ptr< LLEventPollImpl > aThis );
// </FS:ND>
void eventPollCoro(std::string url);
void handleMessage(const LLSD &content);
@ -131,24 +124,13 @@ namespace Details
LLMessageSystem::dispatch(msg_name, message);
}
// <FS:ND> FIRE-19557; Hold on to LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// void LLEventPollImpl::start(const std::string &url)
void LLEventPollImpl::start( const std::string &url, boost::shared_ptr< LLEventPollImpl > aThis )
// </FS:ND>
void LLEventPollImpl::start(const std::string &url)
{
if (!url.empty())
{
// <FS:ND> FIRE-19557; Hold on LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// std::string coroname =
// LLCoros::instance().launch("LLEventPollImpl::eventPollCoro",
// boost::bind(&LLEventPollImpl::eventPollCoro, this, url));
std::string coroname = LLCoros::instance().launch("LLEventPollImpl::eventPollCoro",
boost::bind( &LLEventPollImpl::eventPollCoro, this, url, aThis ) );
// </FS:ND>
std::string coroname =
LLCoros::instance().launch("LLEventPollImpl::eventPollCoro",
boost::bind(&LLEventPollImpl::eventPollCoro, this, url));
LL_INFOS("LLEventPollImpl") << coroname << " with url '" << url << LL_ENDL;
}
}
@ -170,11 +152,8 @@ namespace Details
}
}
// <FS:ND> FIRE-19557; Hold on to LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// void LLEventPollImpl::eventPollCoro(std::string url)
void LLEventPollImpl::eventPollCoro( std::string url, boost::shared_ptr< LLEventPollImpl > aThis )
// </FS:ND>
{
void LLEventPollImpl::eventPollCoro(std::string url)
{
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EventPoller", mHttpPolicy));
LLSD acknowledge;
int errorCount = 0;
@ -323,16 +302,9 @@ namespace Details
LLEventPoll::LLEventPoll(const std::string& poll_url, const LLHost& sender):
mImpl()
{
// <FS:ND> FIRE-19557; Hold on to LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// mImpl = boost::unique_ptr<LLEventPolling::Details::LLEventPollImpl>
// (new LLEventPolling::Details::LLEventPollImpl(sender));
// mImpl->start(poll_url);
mImpl.reset( new LLEventPolling::Details::LLEventPollImpl(sender) );
mImpl->start( poll_url, mImpl );
// </FS:ND>
mImpl = boost::unique_ptr<LLEventPolling::Details::LLEventPollImpl>
(new LLEventPolling::Details::LLEventPollImpl(sender));
mImpl->start(poll_url);
}
LLEventPoll::~LLEventPoll()

View File

@ -57,10 +57,7 @@ public:
private:
// <FS:ND> FIRE-19557; Hold on to LLEventPollImpl while the coroutine runs, otherwise the this pointer can get deleted while the coroutine is still active.
// boost::unique_ptr<LLEventPolling::Details::LLEventPollImpl> mImpl;
boost::shared_ptr<LLEventPolling::Details::LLEventPollImpl> mImpl;
// </FS:ND>
boost::unique_ptr<LLEventPolling::Details::LLEventPollImpl> mImpl;
};