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 GC.KeepAlive() calls in EstimateAffine2D and EstimateAffinePartial2D #1353

Merged
merged 1 commit into from
Dec 23, 2021
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
8 changes: 4 additions & 4 deletions src/OpenCvSharp/Cv2/Cv2_calib3d.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3615,8 +3615,8 @@ public static double SampsonDistance(Point3d pt1, Point3d pt2, double[,] f)
from.CvPtr, to.CvPtr, ToPtr(inliers),
(int) method, ransacReprojThreshold, maxIters, confidence, refineIters, out var matPtr));

GC.KeepAlive(inliers);
GC.KeepAlive(inliers);
GC.KeepAlive(from);
GC.KeepAlive(to);
GC.KeepAlive(inliers);

return (matPtr == IntPtr.Zero) ? null : new Mat(matPtr);
Expand Down Expand Up @@ -3655,8 +3655,8 @@ public static double SampsonDistance(Point3d pt1, Point3d pt2, double[,] f)
from.CvPtr, to.CvPtr, ToPtr(inliers),
(int) method, ransacReprojThreshold, maxIters, confidence, refineIters, out var matPtr));

GC.KeepAlive(inliers);
GC.KeepAlive(inliers);
GC.KeepAlive(from);
GC.KeepAlive(to);
GC.KeepAlive(inliers);

return (matPtr == IntPtr.Zero) ? null : new Mat(matPtr);
Expand Down