diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-23 03:35:16 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-23 03:35:16 +0100 |
commit | 3769a19b06d6bb634625a6b1dfc96dc69ae10c24 (patch) | |
tree | a2d8d2a0769421142f7e9e94e58a3697932dec8f | |
parent | 9a2a5a6b2fc2930e84dc05d5959a83bb1d3eef4c (diff) | |
download | eo_tokenizer-3769a19b06d6bb634625a6b1dfc96dc69ae10c24.zip eo_tokenizer-3769a19b06d6bb634625a6b1dfc96dc69ae10c24.tar.gz |
toknz: use stringshare to store source
-rw-r--r-- | eo_tokenizer.rl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl index b10218d..3bab355 100644 --- a/eo_tokenizer.rl +++ b/eo_tokenizer.rl @@ -76,7 +76,7 @@ Eina_Bool eo_tokenizer_walk(Eo_Tokenizer *toknz, const char *source) { INF("tokenize %s...", source); - toknz->source = source; + toknz->source = eina_stringshare_add(source); FILE *stream; @@ -160,6 +160,9 @@ eo_tokenizer_get() void eo_tokenizer_free(Eo_Tokenizer *toknz) { + if (toknz->source) + eina_stringshare_del(toknz->source); + free(toknz); } |