Skip to content
Merged
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: 0 additions & 2 deletions modules/surface_matching/src/ppf_match_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,7 @@ void PPF3DDetector::match(const Mat& pc, std::vector<Pose3DPtr>& results, const
poseList.push_back(pose);
}

#if defined (_OPENMP)
free(accumulator);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint* accumulator = (uint*)calloc(numAngles*n, sizeof(uint));

BTW, it is better to avoid manual memory management and use cv::AutoBuffer or std::vector.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree.

Unfortunately I found this bug while helping a friend, not using this opencv module myself I do not feel confident enough to refactor the code to a proper "C++ style" memory management.

#endif
}

// TODO : Make the parameters relative if not arguments.
Expand Down