[MacRuby-devel] [MacRuby] #552: NSOperationQueue segfaults when more than one operation is being added
MacRuby
ruby-noreply at macosforge.org
Mon Jan 11 23:10:54 PST 2010
#552: NSOperationQueue segfaults when more than one operation is being added
-------------------------------------+--------------------------------------
Reporter: mattaimonetti@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone: MacRuby 0.5
Component: MacRuby | Keywords:
-------------------------------------+--------------------------------------
Comment(by mattaimonetti@…):
I was able to add two operations as long as they are from 2 different
subclasses:
{{{
framework 'Foundation'
class MyOperation < NSOperation
attr_reader :name
def initWithName(name)
init
@name = name
self
end
def main
puts "Hello #{name}"
end
end
class OtherOperation < NSOperation
attr_reader :name
def initWithName(name)
init
@name = name
self
end
def main
puts "Hello #{name}"
end
end
operation_heidi = MyOperation.alloc.initWithName('Heidi')
operation_matt = OtherOperation.alloc.initWithName('Matt')
queue = NSOperationQueue.alloc.init
queue.addOperation operation_heidi
queue.addOperation operation_matt
# run the main loop for 2 seconds
NSRunLoop.currentRunLoop.runUntilDate(NSDate.dateWithTimeIntervalSinceNow(2.0))
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/552#comment:1>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list