Do I need to close IAsyncOperation?
-
20-06-2021 - |
Frage
In WinRT, do I need to call Close()
on IAsyncOperation<T> ^
objects? Either the the operation initiating code, or in the completion handler? If not, why is it there?
Lösung
From your syntax, you're using C++/CX.
For C++/CX, IAsyncOperation::Close is automatically called in the destructor, so you do not need to explicitly call it.
For JS, you must explicitly call .close().
For C#, it's projected as IDisposable, so a using() statement is appropriate.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow