Skip to main content
IReferenceTrackerHost::DisconnectUnusedReferenceSources method

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

Syntax


HRESULT DisconnectUnusedReferenceSources(
  [in]  XAML_REFERENCETRACKER_DISCONNECT options
);

Parameters

options [in]

May be 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 IReferenceTracker::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

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Windows.ui.xaml.hosting.referencetracker.h

IDL

Windows.ui.xaml.hosting.referencetracker.idl

See also

IReferenceTrackerHost