Class: LIBUSB::Call::Transfer
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LIBUSB::Call::Transfer
- Defined in:
- lib/libusb/call.rb
Instance Method Summary collapse
-
#initialize ⇒ Transfer
constructor
A new instance of Transfer.
Constructor Details
#initialize ⇒ Transfer
Returns a new instance of Transfer.
553 554 555 556 557 558 559 560 561 562 563 564 565 566 |
# File 'lib/libusb/call.rb', line 553 def initialize(*) super ptr = pointer def ptr.free_struct(id) Call.libusb_free_transfer(self) return unless @ctx @ctx.unref_context end # The ctx pointer is not yet assigned. # It happens at LIBUSB::Transfer#dev_handle= later on. ptr.instance_variable_set(:@ctx, nil) ObjectSpace.define_finalizer(self, ptr.method(:free_struct)) end |