Sets whether all objects that implement AutoReleasable interface (e.g. instances of ImageRef) are required to be created inside an autorelease pool.
By default, this is true which means that unless the object is created inside autorelease function, it will throw an error when trying to create it.
We recommend setting this to false only if you are going to use 'await using' syntax when working with objects that contain ImageRef instances.
Otherwise, if you don't manually call release, such object native resources will not be released until the object is garbage collected.
*
Parameters
required: boolean
If true, all objects that implement AutoReleasable interface must be created inside autorelease function.
Sets whether all objects that implement AutoReleasable interface (e.g. instances of ImageRef) are required to be created inside an autorelease pool. By default, this is true which means that unless the object is created inside autorelease function, it will throw an error when trying to create it. We recommend setting this to false only if you are going to use 'await using' syntax when working with objects that contain ImageRef instances. Otherwise, if you don't manually call release, such object native resources will not be released until the object is garbage collected. *