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

Track managed array pinning in Mat #1691

Merged
merged 1 commit into from
Aug 18, 2024
Merged

Track managed array pinning in Mat #1691

merged 1 commit into from
Aug 18, 2024

Conversation

Lillenne
Copy link
Contributor

@Lillenne Lillenne commented Aug 9, 2024

Rationale

Addresses issue #1689 (detailed description there).

Managed arrays are unpinned when the original Mat is disposed or finalized. Captured submat data pointers are not updated on subsequent GC compaction, causing bad data access or AccessViolationExceptions.

Changes

Track GCHandles in the Mat class (via helper class ArrayPinningLifeTime) instead of allowing the DisposeableObject parent class to unpin it when the parent Mat is cleaned up.

Fix #1689

@shimat
Copy link
Owner

shimat commented Aug 18, 2024

Thank you!!

@shimat shimat merged commit ca1f608 into shimat:main Aug 18, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mat from managed array unpinned while submats exist
2 participants