Sha256: b155979c339e4009dc59aefb9548a1afc8de0f0592a252517fc0d56e7751c5fe

Contents?: true

Size: 1015 Bytes

Versions: 9

Compression:

Stored size: 1015 Bytes

Contents

# Copyright 2004-2006 by Kevin Smith
# released under the MIT-style wxruby2 license

class Wx::App
  # This method handles failed assertions from within the WxWidgets C++
  # code. These messages are only generated by a DEBUG build of
  # WxRuby. Such messages usually indicate that the API is being used
  # incorrectly; the file/line reference points to the place in the
  # WxWidgets source code where the assertion was made.
  def on_assert_failure(file, line, condition, message)
    warn "Wx WARNING: #{message} (#{file}:#{line})"
  end

  # For use in development only, of no practical use in production code.
  # This method causes Ruby's garbage collection to run (roughly) at
  # interval +interval+ (seconds) - the default is 1, i.e. every
  # second. This should help ferret out bugs in memory management more
  # quickly.
  def gc_stress(interval = 1)
    t = Wx::Timer.new(self, 9999)
    evt_timer(9999) { Thread.pass }
    Thread.new { loop { sleep interval; GC.start } }
    t.start(100)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wxruby-1.9.1-powerpc-darwin8.3.0 lib/wx/classes/app.rb
wxruby-1.9.1-i686-linux lib/wx/classes/app.rb
wxruby-1.9.1-i686-darwin8.4.1 lib/wx/classes/app.rb
wxruby-1.9.1-i386-mswin32 lib/wx/classes/app.rb
wxruby-1.9.0-powerpc-darwin8.10.0 lib/wx/classes/app.rb
wxruby-1.9.0-i686-linux lib/wx/classes/app.rb
wxruby-1.9.0-i686-darwin8.4.1 lib/wx/classes/app.rb
wxruby-1.9.0-i386-mswin32 lib/wx/classes/app.rb
wxruby-1.9.1-x86_64-linux lib/wx/classes/app.rb