tsm: unicode: fix not recreating the default-table all the time
We actually created a new table all the time which led to huge memory leaks. We now actually use the default table if it is available. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
1 parent
de2536f4e4
commit
090ead3bd6
1 file changed
+6
@@ -233,6 +233,9 @@ const uint32_t *tsm_symbol_get(struct tsm_symbol_table *tbl,
|
||||
return sym;
|
||||
}
|
||||
|
||||
if (!tbl)
|
||||
tbl = tsm_symbol_table_default;
|
||||
|
||||
if (!tbl) {
|
||||
ret = tsm_symbol_table_new(&tbl);
|
||||
if (ret) {
|
||||
@@ -270,6 +273,9 @@ tsm_symbol_t tsm_symbol_append(struct tsm_symbol_table *tbl,
|
||||
bool res;
|
||||
int ret;
|
||||
|
||||
if (!tbl)
|
||||
tbl = tsm_symbol_table_default;
|
||||
|
||||
if (!tbl) {
|
||||
ret = tsm_symbol_table_new(&tbl);
|
||||
if (ret)
|
||||
|
||||
Reference in new issue
Block a user