Module: WindowsGUI::Util
- Defined in:
- lib/windows_gui/common.rb
Defined Under Namespace
Modules: ScopedStruct
Constant Summary collapse
- Id2Ref =
{}
Class Method Summary collapse
Class Method Details
.FormatException(ex) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/windows_gui/common.rb', line 13 def FormatException(ex) str, trace = ex.to_s, ex.backtrace str << "\n\n-- backtrace --\n\n" << trace.join("\n") if trace str end |
.Id2RefTrack(object) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/windows_gui/common.rb', line 25 def Id2RefTrack(object) Id2Ref[object.object_id] = WeakRef.new(object) p "Object id #{object.object_id} of #{object} stored in Id2Ref track hash" if $DEBUG ObjectSpace.define_finalizer(object, -> id { Id2Ref.delete(id) p "Object id #{id} deleted from Id2Ref track hash" if $DEBUG }) end |