diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index bd6fcad78c..f729068c86 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -52,11 +52,7 @@ namespace Details public: LLEventPollImpl(const LLHost &sender); - // 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 ); - // - + 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; - // 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 ); - // + void eventPollCoro(std::string url); void handleMessage(const LLSD &content); @@ -131,24 +124,13 @@ namespace Details LLMessageSystem::dispatch(msg_name, message); } - // 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 ) - // + void LLEventPollImpl::start(const std::string &url) { if (!url.empty()) { - // 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 ) ); - - // - + 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 } } - // 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 ) - // - { + 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() { - // 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 - // (new LLEventPolling::Details::LLEventPollImpl(sender)); - // mImpl->start(poll_url); - - mImpl.reset( new LLEventPolling::Details::LLEventPollImpl(sender) ); - mImpl->start( poll_url, mImpl ); - - // + mImpl = boost::unique_ptr + (new LLEventPolling::Details::LLEventPollImpl(sender)); + mImpl->start(poll_url); } LLEventPoll::~LLEventPoll() diff --git a/indra/newview/lleventpoll.h b/indra/newview/lleventpoll.h index 420b47bd0b..e2afd9226b 100644 --- a/indra/newview/lleventpoll.h +++ b/indra/newview/lleventpoll.h @@ -57,10 +57,7 @@ public: private: - // 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 mImpl; - boost::shared_ptr mImpl; - // + boost::unique_ptr mImpl; };