diff options
Diffstat (limited to 'src/mongo/db/query/internal_plans.h')
-rw-r--r-- | src/mongo/db/query/internal_plans.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mongo/db/query/internal_plans.h b/src/mongo/db/query/internal_plans.h index b623e06aee5..c16aa251f2d 100644 --- a/src/mongo/db/query/internal_plans.h +++ b/src/mongo/db/query/internal_plans.h @@ -90,10 +90,8 @@ namespace mongo { } CollectionScan* cs = new CollectionScan(txn, params, ws, NULL); - PlanExecutor* exec = new PlanExecutor(txn, ws, cs, collection); - // 'exec' will be registered until it is destroyed. - exec->registerExecInternalPlan(); - return exec; + // Takes ownership of 'ws' and 'cs'. + return new PlanExecutor(txn, ws, cs, collection); } /** @@ -125,10 +123,7 @@ namespace mongo { root = new FetchStage(txn, ws, root, NULL, collection); } - PlanExecutor* exec = new PlanExecutor(txn, ws, root, collection); - // 'exec' will be registered until it is destroyed. - exec->registerExecInternalPlan(); - return exec; + return new PlanExecutor(txn, ws, root, collection); } }; |