Skip to content

Commit

Permalink
minor: require instance to be constructed before we make a pool
Browse files Browse the repository at this point in the history
  • Loading branch information
acmorrow committed Sep 18, 2016
1 parent b9143bb commit 7a7f325
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/mongocxx/instance_management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ void configure(mongocxx::uri uri) {
}
};

mongo_access::instance().configure(
mongocxx::stdx::make_unique<mongocxx::instance>(mongocxx::stdx::make_unique<noop_logger>()),
mongocxx::stdx::make_unique<mongocxx::pool>(std::move(uri)));
auto instance =
mongocxx::stdx::make_unique<mongocxx::instance>(mongocxx::stdx::make_unique<noop_logger>());

mongo_access::instance().configure(std::move(instance),
mongocxx::stdx::make_unique<mongocxx::pool>(std::move(uri)));
}

bool do_work() {
Expand Down

0 comments on commit 7a7f325

Please sign in to comment.