Skip to content

Commit

Permalink
Fix object destruction order in APIToModel function to avoid undefine…
Browse files Browse the repository at this point in the history
…d behavior
  • Loading branch information
Phoenix8215 authored Oct 6, 2024
1 parent a94b175 commit c812019
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mobilenet/mobilenetv2/mobilenet_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ void APIToModel(unsigned int maxBatchSize, IHostMemory** modelStream)

// Close everything down
engine->destroy();
builder->destroy();
config->destroy();
builder->destroy();
}

void doInference(IExecutionContext& context, float* input, float* output, int batchSize)
Expand Down
2 changes: 1 addition & 1 deletion mobilenet/mobilenetv3/mobilenet_v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ void APIToModel(unsigned int maxBatchSize, IHostMemory** modelStream, std::strin

// Close everything down
engine->destroy();
builder->destroy();
config->destroy();
builder->destroy();
}

void doInference(IExecutionContext& context, float* input, float* output, int batchSize)
Expand Down

0 comments on commit c812019

Please sign in to comment.