diff options
| -rw-r--r-- | indra/llcommon/llleaplistener.h | 1 | ||||
| -rw-r--r-- | indra/llcommon/llprocess.cpp | 21 | ||||
| -rw-r--r-- | indra/llcommon/llprocess.h | 3 |
3 files changed, 7 insertions, 18 deletions
diff --git a/indra/llcommon/llleaplistener.h b/indra/llcommon/llleaplistener.h index cad4543d02..9663e9a22f 100644 --- a/indra/llcommon/llleaplistener.h +++ b/indra/llcommon/llleaplistener.h @@ -16,7 +16,6 @@ #include <map> #include <string> #include <boost/function.hpp> -#include <boost/ptr_container/ptr_map.hpp> /// Listener class implementing LLLeap query/control operations. /// See https://jira.lindenlab.com/jira/browse/DEV-31978. diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 33a9180cc6..670b740133 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -529,18 +529,9 @@ LLProcess::LLProcess(const LLSDOrParams& params): // preserve existing semantics, we promise that mAttached defaults to the // same setting as mAutokill. mAttached(params.attached.isProvided()? params.attached : params.autokill), - mPool(NULL), - mPipes(NSLOTS) + mPool(NULL) { - // Hmm, when you construct a ptr_vector with a size, it merely reserves - // space, it doesn't actually make it that big. Explicitly make it bigger. - // Because of ptr_vector's odd semantics, have to push_back(0) the right - // number of times! resize() wants to default-construct new BasePipe - // instances, which fails because it's pure virtual. But because of the - // constructor call, these push_back() calls should require no new - // allocation. - for (size_t i = 0; i < mPipes.capacity(); ++i) - mPipes.push_back(0); + mPipes.resize(NSLOTS); if (! params.validateBlock(true)) { @@ -752,11 +743,11 @@ LLProcess::LLProcess(const LLSDOrParams& params): apr_file_t* pipe(mProcess.*(members[i])); if (i == STDIN) { - mPipes.replace(i, new WritePipeImpl(desc, pipe)); + mPipes[i] = std::make_unique<WritePipeImpl>(desc, pipe); } else { - mPipes.replace(i, new ReadPipeImpl(desc, pipe, FILESLOT(i))); + mPipes[i] = std::make_unique<ReadPipeImpl>(desc, pipe, FILESLOT(i)); } // Removed temporaily for Xcode 7 build tests: error was: // "error: expression with side effects will be evaluated despite @@ -1064,14 +1055,14 @@ PIPETYPE* LLProcess::getPipePtr(std::string& error, FILESLOT slot) error = STRINGIZE(mDesc << " has no slot " << slot); return NULL; } - if (mPipes.is_null(slot)) + if (!mPipes[slot]) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a monitored pipe"); return NULL; } // Make sure we dynamic_cast in pointer domain so we can test, rather than // accepting runtime's exception. - PIPETYPE* ppipe = dynamic_cast<PIPETYPE*>(&mPipes[slot]); + PIPETYPE* ppipe = dynamic_cast<PIPETYPE*>(mPipes[slot].get()); if (! ppipe) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a " << typeid(PIPETYPE).name()); diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index cc2d6566fc..d19f480c4a 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -31,7 +31,6 @@ #include "llsdparam.h" #include "llexception.h" #include "apr_thread_proc.h" -#include <boost/ptr_container/ptr_vector.hpp> #include <boost/optional.hpp> #include <boost/noncopyable.hpp> #include <iosfwd> // std::ostream @@ -564,7 +563,7 @@ private: bool mAutokill, mAttached; Status mStatus; // explicitly want this ptr_vector to be able to store NULLs - typedef boost::ptr_vector< boost::nullable<BasePipe> > PipeVector; + typedef std::vector<std::unique_ptr<BasePipe>> PipeVector; PipeVector mPipes; apr_pool_t* mPool; }; |
