F
Frankie
I have been learning about the AsyncOperation class and came across this
code (sorry I got it a few days ago and don't remember the specific link).
Anyway, I am wondering what the tilde (~) on line 12 does or what it means.
I've been using C# for a while and somehow haven't encountered the tilde
yet.
Thanks.
1. namespace System.ComponentModel
2. {
3. public sealed class AsyncOperation
4. {
5. internal AsyncOperation (SynchronizationContext ctx, object state)
6. {
7. this.ctx = ctx;
8. this.state = state;
9. ctx.OperationStarted ();
10. }
11.
12. ~AsyncOperation ()
13. {
14. if (!done && ctx != null)
15. ctx.OperationCompleted ();
16. }
//remaining code omitted
--------------- END OF OP ----------------------
code (sorry I got it a few days ago and don't remember the specific link).
Anyway, I am wondering what the tilde (~) on line 12 does or what it means.
I've been using C# for a while and somehow haven't encountered the tilde
yet.
Thanks.
1. namespace System.ComponentModel
2. {
3. public sealed class AsyncOperation
4. {
5. internal AsyncOperation (SynchronizationContext ctx, object state)
6. {
7. this.ctx = ctx;
8. this.state = state;
9. ctx.OperationStarted ();
10. }
11.
12. ~AsyncOperation ()
13. {
14. if (!done && ctx != null)
15. ctx.OperationCompleted ();
16. }
//remaining code omitted
--------------- END OF OP ----------------------