common: Fix memory leaks in language sorting
https://bugzilla.gnome.org/show_bug.cgi?id=679836
This commit is contained in:
parent
e730edb6cc
commit
d2aa0ce5d8
1 changed files with 9 additions and 9 deletions
|
@ -61,21 +61,21 @@ cc_common_language_sort_languages (GtkTreeModel *model,
|
||||||
|
|
||||||
/* Sort before and after separator first */
|
/* Sort before and after separator first */
|
||||||
if (sa && sb)
|
if (sa && sb)
|
||||||
return 0;
|
result 0;
|
||||||
if (sa)
|
else if (sa)
|
||||||
return ulb ? 1 : -1;
|
result = ulb ? 1 : -1;
|
||||||
if (sb)
|
else if (sb)
|
||||||
return ula ? -1 : 1;
|
result = ula ? -1 : 1;
|
||||||
|
|
||||||
/* Sort user-languages first */
|
/* Sort user-languages first */
|
||||||
if (ula != ulb) {
|
else if (ula != ulb) {
|
||||||
if (ula)
|
if (ula)
|
||||||
return -1;
|
result = -1;
|
||||||
else
|
else
|
||||||
return 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ca)
|
else if (!ca)
|
||||||
result = 1;
|
result = 1;
|
||||||
else if (!cb)
|
else if (!cb)
|
||||||
result = -1;
|
result = -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue