From 48ea442e281473edfeaad2fa63f4c1a472cdfe7e Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Wed, 26 Nov 2014 09:01:34 +0000 Subject: [PATCH] close file descriptor of dictionary lookup pipe --- frontend/apps/reader/modules/readerdictionary.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index b35e876ac..b300b9292 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -64,7 +64,10 @@ function ReaderDictionary:stardictLookup(word, box) -- escape quotes and other funny characters in word local std_out = io.popen("./sdcv --utf8-input --utf8-output -nj "..("%q"):format(word), "r") local results_str = nil - if std_out then results_str = std_out:read("*all") end + if std_out then + results_str = std_out:read("*all") + std_out:close() + end --DEBUG("result str:", word, results_str) local ok, results = pcall(JSON.decode, JSON, results_str) if ok and results then