summaryrefslogtreecommitdiffstats
path: root/windows.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-03-02 16:14:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-02 08:45:42 -0800
commit3443abea721c9d5d8100c82e5b2dc9f543c5092c (patch)
tree0638eeaaa9667cc90e235f6baa5216e026e6c387 /windows.c
parentaa02798e2a6ca1a91dbfe444327f5eeb61744ea6 (diff)
downloadsubsurface-3443abea721c9d5d8100c82e5b2dc9f543c5092c.tar.gz
windows.c: Fix broken subsurface_unset_conf()
windows.c has be revisited so many times, yet just now I've noticed that we aren't deleting/unsetting a configuration value ever. What has went strangely unnoticed is that subsurface_unset_conf() needs RegDeleteValue instead of RegDeleteKey. "keys" in the Windows registry are like folders which contain files (or "values"). So in this case we need to delete a "file" and not a "folder" using RegDeleteValue(). This ended up being a problem with the new prefs.c logic, where there is a check if a config value is the default value and then it will be unset/deleted. There was potential for a crash, where a NULL value can reach pango_font_description_from_string() for the divelist font. It also wasn't possible to change the divelist font back to the default font (e.g. Sans 8), once a different font was selected. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/windows.c b/windows.c
index 2eed74143..b711480f3 100644
--- a/windows.c
+++ b/windows.c
@@ -22,7 +22,7 @@ void subsurface_open_conf(void)
void subsurface_unset_conf(char *name)
{
- RegDeleteKey(hkey, (LPCTSTR)name);
+ RegDeleteValue(hkey, (LPCTSTR)name);
}
void subsurface_set_conf(char *name, const char *value)