std.windows.registry: Keep Key object alive while iterating over it#5749
std.windows.registry: Keep Key object alive while iterating over it#5749dlang-bot merged 1 commit intodlang:stablefrom
Conversation
The `Key` and `{Key,Value}NameSequence` objects weren't referenced during
and after iteration in `...NameSequence.opApply()`, so there was no
guarantee the `Key` object owning the HKEY handle would stay alive and
keep the handle open - its destructor closes the handle.
This lead to a failing std.datetime.timezone unittest for optimized LDC
builds.
|
Thanks for your pull request, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
| } | ||
|
|
||
| private void regProcessNthKey(HKEY hkey, scope void delegate(scope LONG delegate(DWORD, out string)) dg) | ||
| private void regProcessNthKey(Key key, scope void delegate(scope LONG delegate(DWORD, out string)) dg) |
There was a problem hiding this comment.
Anything blocking? ;) - I'm not sure whether decorating the key param with scope makes a difference.
|
Thanks. :) |
The
Keyand{Key,Value}NameSequenceobjects weren't referenced during and after iteration in...NameSequence.opApply(), so there was no guarantee theKeyobject owning the HKEY handle would stay alive and keep the handle open - its destructor closes the handle.This lead to a failing
std.datetime.timezoneunittest for optimized LDC builds.Pinging @klickverbot @ZombineDev @rainers as involved in the discussion starting here.