summaryrefslogtreecommitdiffstats
path: root/eo_tokenizer.rl
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-23 03:35:16 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-23 03:35:16 +0100
commit3769a19b06d6bb634625a6b1dfc96dc69ae10c24 (patch)
treea2d8d2a0769421142f7e9e94e58a3697932dec8f /eo_tokenizer.rl
parent9a2a5a6b2fc2930e84dc05d5959a83bb1d3eef4c (diff)
downloadeo_tokenizer-3769a19b06d6bb634625a6b1dfc96dc69ae10c24.zip
eo_tokenizer-3769a19b06d6bb634625a6b1dfc96dc69ae10c24.tar.gz
toknz: use stringshare to store source
Diffstat (limited to 'eo_tokenizer.rl')
-rw-r--r--eo_tokenizer.rl5
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);
}