Created
November 30, 2012 20:10
-
-
Save alexrothenberg/4178247 to your computer and use it in GitHub Desktop.
RubyMotion 1.29 crash - reported as issue #344
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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