method
unbind
v1_9_3_392 -
Show latest stable
-
0 notes -
Class: Function
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
unbind()
public
Hide source
# File ext/dl/lib/dl/func.rb, line 159 def unbind() if DL.fiddle? then if @cfunc.kind_of?(Fiddle::Closure) and @cfunc.ptr != 0 then call_type = case abi when CALL_TYPE_TO_ABI[nil] nil when CALL_TYPE_TO_ABI[:stdcall] :stdcall else raise(RuntimeError, "unsupported abi: #{abi}") end @cfunc = CFunc.new(0, @cfunc.ctype, name, call_type) return 0 elsif @cfunc.ptr != 0 then @cfunc.ptr = 0 return 0 else return nil end end if( @cfunc.ptr != 0 ) case @cfunc.calltype when :cdecl remove_cdecl_callback(@cfunc.ptr, @cfunc.ctype) when :stdcall remove_stdcall_callback(@cfunc.ptr, @cfunc.ctype) else raise(RuntimeError, "unsupported calltype: #{@cfunc.calltype}") end @cfunc.ptr = 0 end end