Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Generator assumes non-null struct member IDisposables. #81

Open
plynkus opened this issue Apr 17, 2019 · 0 comments
Open

Generator assumes non-null struct member IDisposables. #81

plynkus opened this issue Apr 17, 2019 · 0 comments

Comments

@plynkus
Copy link

plynkus commented Apr 17, 2019

Observed: NREs fired during disposal of valid WriteDescriptorSet instances (some members null).

Current generated Dispose() for WriteDescriptorSet:

		override public void Dispose (bool disposing)
		{
			base.Dispose (disposing);
			if (!disposing)
				return;
			refImageInfo.Dispose ();
			refImageInfo = null;
			refBufferInfo.Dispose ();
			refBufferInfo = null;
			refTexelBufferView.Dispose ();
			refTexelBufferView = null;
		}

...but per the spec, null is valid for each (ignored, depending on the rest of the configuration).

Suggested fix (not locally tested here but seems pretty obvious) is to change the generator's disposal emits to, e.g., refImageInfo?.Dispose ();.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant