Skip to content

GWin32RegistryKey: Move assertions

LRN requested to merge lrn/glib:win32reg-assertions into master

While these assertions look right at the first glance, they actually crash the program. That's because GObject insists on initializing all construct-only properties to their default values, which results in g_win32_registry_key_set_property() being called multiple times with NULL string, once for each unset property.

If "path" is actually set by the caller, a subsequent call to set "path-utf16" to NULL will fail an assertion, since absolute_path is already non-NULL.

With assertions moved the set-to-NULL calls bail out before an assertion is made.

Merge request reports