Skip to content

Instantly share code, notes, and snippets.

@alexrothenberg
Created November 30, 2012 20:10
Show Gist options
  • Save alexrothenberg/4178247 to your computer and use it in GitHub Desktop.
Save alexrothenberg/4178247 to your computer and use it in GitHub Desktop.
RubyMotion 1.29 crash - reported as issue #344
# We crash with this definition
# Could the superclass be freed by RubyMotion's automatic memory management???
class Person < Struct.new(:name)
end
# # Everything is fine if we define Person without Struct.new
# class Person
# attr_reader :name
# def initialize(attributes)
# @name = attributes[:name]
# end
# end
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.makeKeyAndVisible
AppDelegate.buggy
true
end
def self.buggy
fire = proc {
puts Person.new(name: 'Alex')
}
@timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: fire, selector: 'call:', userInfo: nil, repeats: true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment