#552: NSOperationQueue segfaults when more than one operation is being added
-------------------------------------+--------------------------------------
 Reporter:  mattaimone...@…          |       Owner:  lsansone...@…        
     Type:  defect                   |      Status:  new                  
 Priority:  blocker                  |   Milestone:  MacRuby 0.5          
Component:  MacRuby                  |    Keywords:                       
-------------------------------------+--------------------------------------

Comment(by mattaimone...@…):

 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/>

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to