Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memleak #86

Merged
merged 3 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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