lib/ffi/msgpack/msg_object.rb in ffi-msgpack-0.1.2 vs lib/ffi/msgpack/msg_object.rb in ffi-msgpack-0.1.3
- old
+ new
@@ -182,11 +182,11 @@
entries = FFI::MemoryPointer.new(MsgKeyValue,values.length)
values.each_with_index do |(key,value),index|
pair = MsgKeyValue.new(entries[index])
- pair[:key] = MsgObject.new_object(key)
- pair[:value] = MsgObject.new_object(value)
+ MsgObject.new_object(key,pair[:key].to_ptr)
+ MsgObject.new_object(value,pair[:value].to_ptr)
end
obj = MsgObject.new
obj[:type] = :map
obj[:values][:map][:size] = values.length