IJavaPeerable.DisposeUnlessReferenced Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
If there are no outstanding references to this instance, then
calls Dispose()
; otherwise, does nothing.
public void DisposeUnlessReferenced ();
abstract member DisposeUnlessReferenced : unit -> unit
Remarks
Call this method when you would like to allow instances to be collectable as soon as possible, but not if the current instance is referenced anywhere else.
[JniTypeSignature ("my/Example")]
partial class ExampleBinding : IJavaPeerable {
public void DisposeUnlessReferenced ()
{
JniEnvironment.Runtime.ValueManager.DisposeUnlessReferenced (this);
}
}