File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ extern "C"
5959
6060 PDALPipelinePtr PDALCreatePipeline (const char * json)
6161 {
62- Pipeline* pipeline = new Pipeline ();
62+ std::unique_ptr< Pipeline> pipeline = std::make_unique< Pipeline> ();
6363 if (json && std::strlen (json) > 0 )
6464 {
6565 try
@@ -75,7 +75,6 @@ extern "C"
7575 catch (const std::exception &e)
7676 {
7777 printf (" Could not create pipeline: %s\n %s\n " , e.what (), json);
78- delete pipeline;
7978 return nullptr ;
8079 }
8180
@@ -86,11 +85,10 @@ extern "C"
8685 catch (const std::exception &e)
8786 {
8887 printf (" Error while validating pipeline: %s\n %s\n " , e.what (), json);
89- delete pipeline;
9088 return nullptr ;
9189 }
9290
93- return pipeline;
91+ return pipeline. release () ;
9492 }
9593 return nullptr ;
9694 }
You can’t perform that action at this time.
0 commit comments