From 3b84e7162e2d328ea7ea2e8c53c70cb6d8cb4dc4 Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 29 Dec 2009 19:26:54 -0800 Subject: [PATCH] SERVER-470 MINOR don't need persistent handles for copied function arguments --- scripting/v8_utils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripting/v8_utils.cpp b/scripting/v8_utils.cpp index ee8cf5b38d2..05910162992 100644 --- a/scripting/v8_utils.cpp +++ b/scripting/v8_utils.cpp @@ -204,13 +204,10 @@ namespace mongo { fun = config_.f_; } Context::Scope context_scope( context ); - // TODO maybe we can get away with local handles here - boost::scoped_array< Persistent< Value > > argv( new Persistent< Value >[ config_.args_.size() ] ); + boost::scoped_array< Local< Value > > argv( new Local< Value >[ config_.args_.size() ] ); for( unsigned int i = 0; i < config_.args_.size(); ++i ) - argv[ i ] = Persistent< Value >::New( config_.args_[ i ] ); + argv[ i ] = Local< Value >::New( config_.args_[ i ] ); Local< Value > ret = fun->Call( context->Global(), config_.args_.size(), argv.get() ); - for( unsigned int i = 0; i < config_.args_.size(); ++i ) - argv[ i ].Dispose(); config_.returnData_ = Persistent< Value >::New( ret ); } private: