I am making progress with my openssl TLS provider such that it’s actually 
making calls etc. However, when things are closing down I am getting an object 
being disposed of multiple times from different places. The X509 context object 
is being disposed of. The first time the sequence of calls is show in:

https://pastebin.com/jWrzfd2P

The disposal will null the handle:


                protected void Dispose (bool disposing)

                {

                        if (disposing) {

                                try {

                                        if (handle != null) {

                                                Close ();

                                                handle.Dispose ();

                                                handle = null;

                                        }

                                } finally {

                                        var disposedExc = new 
ObjectDisposedException (GetType ().Name);

                                        Interlocked.CompareExchange (ref 
lastError, disposedExc, null);

                                }

                        }

                }

But then Dispose is called via this sequence:

https://pastebin.com/qAeXdrLd

And, lo & behold, the value of handle is exactly the same (and not null). I 
have verified that a new handle had not been created. The openssl code is 
almost identical to the btls code (it is identical if you ignore naming of 
variables and methods).

This code was cloned from master on Wednesday afternoon.

Neale




_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.dot.net
http://lists.dot.net/mailman/listinfo/mono-devel-list

Reply via email to