Use unique_ptr instead of raw pointer (#77)

This commit is contained in:
Jack Zhou
2022-08-08 19:41:01 +08:00
committed by GitHub
parent 0e45a7e4aa
commit 60ac898ece
3 changed files with 11 additions and 15 deletions

View File

@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "fastdeploy/fastdeploy_model.h"
#include "fastdeploy/utils/unique_ptr.h"
#include "fastdeploy/utils/utils.h"
namespace fastdeploy {
@@ -53,7 +54,7 @@ bool FastDeployModel::InitRuntime() {
<< std::endl;
return false;
}
runtime_ = std::unique_ptr<Runtime>(new Runtime());
runtime_ = utils::make_unique<Runtime>();
if (!runtime_->Init(runtime_option)) {
return false;
}