Skip to content

Commit

Permalink
Remove AutoPointer.new with block from documentation
Browse files Browse the repository at this point in the history
It was never implemented since it doesn't work.

Fixes #1071
  • Loading branch information
larskanis committed Apr 22, 2024
1 parent b2a7ce4 commit 475b5ec
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/ffi/autopointer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ class AutoPointer < Pointer
# @note WARNING: passing a proc _may_ cause your pointer to never be
# GC'd, unless you're careful to avoid trapping a reference to the
# pointer in the proc. See the test specs for examples.
# @overload initialize(pointer) { |p| ... }
# @param pointer [Pointer]
# @yieldparam [Pointer] p +pointer+ passed to the block
# @return [self]
# The passed block will be invoked at GC time.
# @note
# WARNING: passing a block will cause your pointer to never be GC'd.
# This is bad.
# @overload initialize(pointer)
# @param pointer [Pointer]
# @return [self]
Expand All @@ -75,7 +67,7 @@ class AutoPointer < Pointer
# The last calling idiom (only one parameter) is generally only
# going to be useful if you subclass {AutoPointer}, and override
# #release, which by default does nothing.
def initialize(ptr, proc=nil, &block)
def initialize(ptr, proc=nil)
raise TypeError, "Invalid pointer" if ptr.nil? || !ptr.kind_of?(Pointer) ||
ptr.kind_of?(MemoryPointer) || ptr.kind_of?(AutoPointer)
super(ptr.type_size, ptr)
Expand Down

0 comments on commit 475b5ec

Please sign in to comment.