summaryrefslogtreecommitdiff
path: root/ext/win32ole/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-16 09:45:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-16 09:45:48 +0000
commit0c61c3b67b548ab73b54e795efc4bb1b7d8e19b9 (patch)
treed6fadab03673c85f34ced8383101b33367c360ea /ext/win32ole/lib
parent2d59c39978481cc5ae5a90eaa6c585488eb7a306 (diff)
win32ole.rb: use TracePoint
* ext/win32ole/lib/win32ole.rb: use TracePoint to hook all thread creation not only by Thread.new and to get rid of interference with svar scope. [Bug #7681] [ruby-core:51365] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/lib')
-rw-r--r--ext/win32ole/lib/win32ole.rb19
1 files changed, 2 insertions, 17 deletions
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb
index aaf7e7c..16c2012 100644
--- a/ext/win32ole/lib/win32ole.rb
+++ b/ext/win32ole/lib/win32ole.rb
@@ -3,20 +3,5 @@ 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
+TracePoint.trace(:thread_begin) {WIN32OLE.ole_initialize}
+TracePoint.trace(:thread_end) {WIN32OLE.ole_uninitialize}