1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/win32ole/lib/win32ole.rb
suke 4b18062808 * ext/win32ole/win32ole.c: add WIN32OLE.ole_initialize,
WIN32OLE.ole_uninitialize to use in win32ole.rb.
  You must not use thease methods.

* ext/win32ole/lib/win32ole.rb: add win32ole.rb 
  re-define Thread#initialize (fix ruby-core:27634)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-23 11:02:17 +00:00

22 lines
403 B
Ruby

require 'win32ole.so'
# re-define Thread#initialize
# bug #2618(ruby-core:27634)
class Thread
alias :org_initialize :initialize
def initialize(*arg, &block)
if block
org_initialize(*arg) {
WIN32OLE.ole_initialize
begin
block.call(*arg)
ensure
WIN32OLE.ole_uninitialize
end
}
else
org_initialize(*arg)
end
end
end