IReferenceTrackerHost::DisconnectUnusedReferenceSources method (microsoft.ui.xaml.hosting.referencetracker.h)

Requests that the host perform garbage collection and remove all unnecessary reference sources.

Syntax

HRESULT DisconnectUnusedReferenceSources(
  [in] XAML_REFERENCETRACKER_DISCONNECT options
);

Parameters

[in] options

0 or 1.

1 indicates that an application suspend is in progress.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method is expected to potentially cause the reference source to call DisconnectFromTrackerSource, but it is not necessary to call IUnknown::Release immediately on the tracker source. In the CLR, this call triggers a garbage collection, but not a WaitForPendingFinalizers. When flags is one, the garbage collection is executed in the GCCollectionMode.Optimized state.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1809 (with Windows App SDK 0.5 or later)
Header microsoft.ui.xaml.hosting.referencetracker.h