lib/ngt/utils.rb in ngt-0.4.0 vs lib/ngt/utils.rb in ngt-0.4.1
- old
+ new
@@ -2,10 +2,13 @@
module Utils
# private
def self.ffi(method, *args)
res = FFI.send(method, *args)
message = FFI.ngt_get_error_string(args.last)
- raise Error, message unless message.empty?
+ unless message.empty?
+ FFI.ngt_clear_error_string(args.last)
+ raise Error, message
+ end
res
end
private