Skip to content

Commit

Permalink
Revert "Easy::Operations#handle: Thread-safe cleanup (#136)"
Browse files Browse the repository at this point in the history
This reverts commit b4899b9.

Fix #194
  • Loading branch information
tagliala authored and Kjarrigan committed Jun 11, 2021
1 parent 1e1061f commit be74d1b
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/ethon/easy/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,14 @@ class Easy
# This module contains the logic to prepare and perform
# an easy.
module Operations

class PointerHelper
class<<self
def synchronize( &block )
(@mutex ||= Mutex.new).synchronize( &block )
end

def release( pointer )
synchronize { Curl.easy_cleanup pointer }
end
end
synchronize{}
end

# Returns a pointer to the curl easy handle.
#
# @example Return the handle.
# easy.handle
#
# @return [ FFI::Pointer ] A pointer to the curl easy handle.
def handle
@handle ||= FFI::AutoPointer.new(Curl.easy_init, PointerHelper.method(:release) )
@handle ||= FFI::AutoPointer.new(Curl.easy_init, Curl.method(:easy_cleanup))
end

# Sets a pointer to the curl easy handle.
Expand Down

0 comments on commit be74d1b

Please sign in to comment.