Skip to content

Conversation

@Carti-it
Copy link

@Carti-it Carti-it commented Feb 9, 2026

Co-authored-by: Felipe Quintella <felipe@quintella.com>
this.queue?.Dispose();

Marshal.FreeHGlobal(this.bitmapHeader);
this.session = null;
Copy link
Author

Choose a reason for hiding this comment

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

Setting to null explicitly feels good to ensure that a NullReferenceException is thrown if somebody tries to access it later.

this.session?.Dispose();
this.deviceInput?.Dispose();
this.deviceOutput?.Dispose();
this.device?.Dispose();
Copy link
Author

Choose a reason for hiding this comment

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

I moved this.device?.Dispose(); below deviceInput.Dispose() and deviceOutput.Dispose() as it feels more correct.

Especially, since there is this constructor: public AVCaptureDeviceInput(AVCaptureDevice device)

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.

1 participant