summaryrefslogtreecommitdiff
path: root/indra/llcommon/llcoros.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llcoros.cpp')
-rw-r--r--indra/llcommon/llcoros.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index 4bab669046..3165ce0743 100644
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -283,6 +283,7 @@ void LLCoros::setStackSize(S32 stacksize)
void LLCoros::printActiveCoroutines()
{
+ LL_INFOS("LLCoros") << "Number of active coroutines: " << (S32)mCoros.size() << LL_ENDL;
LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------";
CoroMap::iterator iter;
CoroMap::iterator end = mCoros.end();
@@ -401,7 +402,13 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl
std::string name(generateDistinctName(prefix));
Current current;
// pass the current value of Current as previous context
- CoroData* newCoro = new CoroData(current, name, callable, mStackSize);
+ CoroData* newCoro = new(std::nothrow) CoroData(current, name, callable, mStackSize);
+ if (newCoro == NULL)
+ {
+ // Out of memory?
+ printActiveCoroutines();
+ LL_ERRS("LLCoros") << "Failed to start coroutine: " << name << " Stacksize: " << mStackSize << " Total coroutines: " << mCoros.size() << LL_ENDL;
+ }
// Store it in our pointer map
mCoros.insert(name, newCoro);
// also set it as current