From 3769a19b06d6bb634625a6b1dfc96dc69ae10c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 23 Nov 2013 02:35:16 +0000 Subject: toknz: use stringshare to store source --- eo_tokenizer.rl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- cgit v1.1-2-g2b99