Skip to content

Commit cfbb4c4

Browse files
committed
use unique_ptr
1 parent 95f20b9 commit cfbb4c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paddle/trainer/TrainerMain.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ int main(int argc, char** argv) {
3737
initMain(argc, argv);
3838
initPython(argc, argv);
3939

40+
std::unique_ptr<PServerUtil> pServerPtr(nullptr);
4041
if (FLAGS_start_pserver) {
41-
PServerUtil* pServerUtil = paddle::PServerUtil::createWithGflags();
42-
pServerUtil->start();
42+
pServerPtr.reset(paddle::PServerUtil::createWithGflags());
43+
pServerPtr->start();
4344
}
4445
Trainer trainer;
4546
auto config = TrainerConfigHelper::createFromFlags();

0 commit comments

Comments
 (0)