[UnixRegistry] Fix leak (#25559), remove races.
authorMiguel de Icaza <miguel@gnome.org>
Tue, 3 Mar 2015 21:18:51 +0000 (16:18 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 3 Mar 2015 21:19:37 +0000 (16:19 -0500)
commit826060172f668401a8e69e7ec7fc7e838941c556
treeb3686aa48a339c07596e5ea7fc4ef5bd6551dc4d
parentef380e3712af86ef7f8064fab19400523c7510c0
[UnixRegistry] Fix leak (#25559), remove races.

There was a memory leak caused by not having a lookup mechanism for
the RegistryKey.  In addition, the entire code to dispose code was
never used (due to the leak), and it was wrong.

In addition, added locking to the "values" field, which currently was
racy.

No test cases, the repro is to run the above code for about 5 minutes.
mcs/class/corlib/Microsoft.Win32/RegistryKey.cs
mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs