mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Copy default filename string when assigning to default preferences
This tries to remove subtle ownership issues. When copying preferences structures, the default filename is copied. But the default preferences struct simply takes a pointer to a global string which is free()d in main(). Now, this is not strictly a bug because the free()ing of preferences resources is not implemented. Yet, let's try to make this consistent. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
4c1a2cc8dc
commit
7a99d7e5c3
1 changed files with 1 additions and 1 deletions
|
@ -295,7 +295,7 @@ void setup_system_prefs(void)
|
|||
default_prefs.font_size = system_divelist_default_font_size;
|
||||
|
||||
#if !defined(SUBSURFACE_MOBILE)
|
||||
default_prefs.default_filename = system_default_filename();
|
||||
default_prefs.default_filename = copy_string(system_default_filename());
|
||||
#endif
|
||||
env = getenv("LC_MEASUREMENT");
|
||||
if (!env)
|
||||
|
|
Loading…
Add table
Reference in a new issue