From cbf146f2b3fc255bc83f2b01101dc29658bea6ea Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 24 Oct 2019 12:54:38 -0400 Subject: DRTVWR-476: Pump coroutines a few more times when we start quitting. By the time "LLApp" listeners are notified that the app is quitting, the mainloop is no longer running. Even though those listeners do things like close work queues and inject exceptions into pending promises, any coroutines waiting on those resources must regain control before they can notice and shut down properly. Add a final "LLApp" listener that resumes ready coroutines a few more times. Make sure every other "LLApp" listener is positioned before that new one. --- indra/llcommon/lleventcoro.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/lleventcoro.cpp') diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp index 967c4d74d8..785c231f2c 100644 --- a/indra/llcommon/lleventcoro.cpp +++ b/indra/llcommon/lleventcoro.cpp @@ -153,6 +153,7 @@ postAndSuspendSetup(const std::string& callerName, // The relative order of the two listen() calls below would only matter if // "LLApp" were an LLEventMailDrop. But if we ever go there, we'd want to // notice the pending LLApp status first. + // Run this listener before the "final" listener. LLBoundListener stopper( LLEventPumps::instance().obtain("LLApp").listen( listenerName, @@ -181,7 +182,9 @@ postAndSuspendSetup(const std::string& callerName, } // do not consume -- every listener must see status return false; - })); + }, + LLEventPump::NameList{}, // after + LLEventPump::NameList{ "final "})); // before LLBoundListener connection( replyPump.listen( listenerName, -- cgit v1.2.3