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

Generator assumes non-null struct member IDisposables. #81

@plynkus

Description

@plynkus

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 ();.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions