Discussion:
[PATCH] fix segfault when changing sort keys while adding tracks
Johannes Weißl
2011-04-04 14:35:29 UTC
Permalink
---
options.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/options.c b/options.c
index 75eca52..1e7f3b3 100644
--- a/options.c
+++ b/options.c
@@ -302,7 +302,9 @@ static void set_lib_sort(unsigned int id, const char *buf)
sort_key_t *keys = parse_sort_keys(buf);

if (keys) {
+ editable_lock();
editable_set_sort_keys(&lib_editable, keys);
+ editable_unlock();
sort_keys_to_str(keys, lib_editable.sort_str, sizeof(lib_editable.sort_str));
}
}
@@ -317,7 +319,9 @@ static void set_pl_sort(unsigned int id, const char *buf)
sort_key_t *keys = parse_sort_keys(buf);

if (keys) {
+ editable_lock();
editable_set_sort_keys(&pl_editable, keys);
+ editable_unlock();
sort_keys_to_str(keys, pl_editable.sort_str, sizeof(pl_editable.sort_str));
}
}
--
1.7.4.1
Gregory Petrosyan
2011-04-05 21:04:25 UTC
Permalink
Post by Johannes Weißl
--- a/options.c
+++ b/options.c
@@ -302,7 +302,9 @@ static void set_lib_sort(unsigned int id, const char *buf)
sort_key_t *keys = parse_sort_keys(buf);
if (keys) {
+ editable_lock();
editable_set_sort_keys(&lib_editable, keys);
+ editable_unlock();
sort_keys_to_str(keys, lib_editable.sort_str, sizeof(lib_editable.sort_str));
}
Merged to both master and maint, thanks a lot!

Gregory

Loading...