summaryrefslogtreecommitdiff
path: root/indra/llcommon/lleventcoro.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2019-04-18 15:44:45 -0700
committerNat Goodspeed <nat@lindenlab.com>2020-03-25 18:39:21 -0400
commit6419c6e279816b21e30fef1a6ac4864df7fcf91d (patch)
tree8e1963a9b6b006255ff85b7ee868e52b6177c2cf /indra/llcommon/lleventcoro.cpp
parentc26c2bc3f0a4c254aac8ded86162d72eee7dea0a (diff)
Removed unnecessary disconnection of listener in postAndSuspendSetup
Diffstat (limited to 'indra/llcommon/lleventcoro.cpp')
-rw-r--r--indra/llcommon/lleventcoro.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
index 421897cb98..b1fb8ffd04 100644
--- a/indra/llcommon/lleventcoro.cpp
+++ b/indra/llcommon/lleventcoro.cpp
@@ -134,15 +134,12 @@ LLBoundListener postAndSuspendSetup(const std::string& callerName,
// return the consuming attribute for some other coroutine, most likely
// the main routine.
bool consuming(LLCoros::get_consuming());
-
- std::shared_ptr<LLBoundListener> connection_ptr = std::make_shared<LLBoundListener>();
-
// make a callback that will assign a value to the future, and listen on
// the specified LLEventPump with that callback
- *connection_ptr = replyPump.getPump().listen(listenerName,
- [&promise, consuming, listenerName, connection_ptr](const LLSD& result)
+ LLBoundListener connection(
+ replyPump.getPump().listen(listenerName,
+ [&promise, consuming, listenerName](const LLSD& result)
{
- connection_ptr->disconnect();
try
{
promise.set_value(result);
@@ -153,7 +150,7 @@ LLBoundListener postAndSuspendSetup(const std::string& callerName,
<< listenerName << "' " << ex.what() << LL_ENDL;
}
return consuming;
- });
+ }));
// skip the "post" part if requestPump is default-constructed
if (requestPump)
{
@@ -172,7 +169,7 @@ LLBoundListener postAndSuspendSetup(const std::string& callerName,
LL_DEBUGS("lleventcoro") << callerName << ": coroutine " << listenerName
<< " about to wait on LLEventPump " << replyPump.getPump().getName()
<< LL_ENDL;
- return *connection_ptr;
+ return connection;
}
} // anonymous