Skip to content

Commit

Permalink
Merge pull request #1097 from larskanis/AutoPointer-without-block
Browse files Browse the repository at this point in the history
Remove AutoPointer.new with block from documentation
  • Loading branch information
larskanis committed Apr 23, 2024
2 parents b2a7ce4 + 475b5ec commit 769a4bd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/ffi/autopointer.rb
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 769a4bd

Please sign in to comment.