Skip to content

Commit

Permalink
fix: bugprone-error
Browse files Browse the repository at this point in the history
Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 committed Dec 23, 2024
1 parent a88e90e commit ab99235
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,15 @@ TrtClassifier::TrtClassifier(

TrtClassifier::~TrtClassifier()
{
if (m_cuda) {
if (h_img_) CHECK_CUDA_ERROR(cudaFreeHost(h_img_));
if (d_img_) CHECK_CUDA_ERROR(cudaFree(d_img_));
try {
if (m_cuda) {
if (h_img_) CHECK_CUDA_ERROR(cudaFreeHost(h_img_));
if (d_img_) CHECK_CUDA_ERROR(cudaFree(d_img_));
}
} catch (const std::exception & e) {
std::cerr << "Exception in TrtClassifier destructor: " << e.what() << std::endl;
} catch (...) {

Check warning on line 203 in perception/autoware_tensorrt_classifier/src/tensorrt_classifier.cpp

View check run for this annotation

Codecov / codecov/patch

perception/autoware_tensorrt_classifier/src/tensorrt_classifier.cpp#L201-L203

Added lines #L201 - L203 were not covered by tests
std::cerr << "Unknown exception in TrtClassifier destructor" << std::endl;
}
}

Expand Down

0 comments on commit ab99235

Please sign in to comment.