summaryrefslogtreecommitdiff
path: root/ext/win32ole/lib
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-23 11:02:17 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-23 11:02:17 +0000
commit4b18062808a3731e5ffabb82e0b5dcbe207d5672 (patch)
tree4dd60c302dd1c740af461a505e4be684378afffa /ext/win32ole/lib
parent0f29696f9d38642962766ecee2c2f9008675e7dd (diff)
* 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
Diffstat (limited to 'ext/win32ole/lib')
-rw-r--r--ext/win32ole/lib/win32ole.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb
new file mode 100644
index 0000000..aaf7e7c
--- /dev/null
+++ b/ext/win32ole/lib/win32ole.rb
@@ -0,0 +1,22 @@
+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