Skip to content

Commit

Permalink
Fix memleak (#86)
Browse files Browse the repository at this point in the history
* delete []

* fix build error when enble MMDEPLOY_ACTIVE_LEVEL

* fix lint
  • Loading branch information
lvhan028 authored Jan 20, 2022
1 parent cfb9099 commit c74c41b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion csrc/apis/c/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ MM_SDK_API void mmdeploy_detector_release_result(mm_detect_t* results, const int
for (int i = 0; i < count; ++i) {
for (int j = 0; j < result_count[i]; ++j, ++result_ptr) {
if (result_ptr->mask) {
delete result_ptr->mask->data;
delete[] result_ptr->mask->data;
delete result_ptr->mask;
}
}
Expand Down
2 changes: 1 addition & 1 deletion csrc/codebase/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace mmdeploy {
class Context {
public:
explicit Context(const Value& config) {
DEBUG("config: {}", cfg);
DEBUG("config: {}", config);
device_ = config["context"]["device"].get<Device>();
stream_ = config["context"]["stream"].get<Stream>();
}
Expand Down
3 changes: 1 addition & 2 deletions csrc/codebase/mmdet/object_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ Result<DetectorOutput> ResizeBBox::GetBBoxes(const Value& prep_res, const Tensor
rect[3] - rect[1]);
continue;
}
DEBUG("remap left {}, top {}, right {}, bottom {}", rect.left, rect.top, rect.right,
rect.bottom);
DEBUG("remap left {}, top {}, right {}, bottom {}", rect[0], rect[1], rect[2], rect[3]);
DetectorOutput::Detection det{};
det.index = i;
det.label_id = static_cast<int>(*labels_ptr);
Expand Down

0 comments on commit c74c41b

Please sign in to comment.