lib/mini_magick/shell.rb in mini_magick-4.9.1 vs lib/mini_magick/shell.rb in mini_magick-4.9.2

- old
+ new

@@ -49,13 +49,14 @@ rescue Errno::EPIPE end in_w.close begin - Timeout.timeout(MiniMagick.timeout, nil, "MiniMagick command timed out: #{command}") { thread.join } - ensure + Timeout.timeout(MiniMagick.timeout) { thread.join } + rescue Timeout::Error Process.kill("TERM", thread.pid) rescue nil Process.waitpid(thread.pid) rescue nil + raise Timeout::Error, "MiniMagick command timed out: #{command}" end [stdout_reader.value, stderr_reader.value, thread.value] end end