[UnixRegistry] Fix leak (#25559), remove races.
authorMiguel de Icaza <miguel@gnome.org>
Sat, 7 Mar 2015 02:18:42 +0000 (21:18 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 7 Mar 2015 02:18:51 +0000 (21:18 -0500)
commitf1ad4d5beeaf22ecaf6856776e22dd747fc01170
treef555ca6735759b11dc4a29f543897ac3f211220d
parent4f458a4ff72bc6c5e07f82aec9040d355cbb8f5c
[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