[MacRuby-devel] [MacRuby] #376: The second 'pointer' of a double pointer type is ignored

MacRuby ruby-noreply at macosforge.org
Fri Oct 9 19:10:56 PDT 2009

#376: The second 'pointer' of a double pointer type is ignored
 Reporter:  mred@…               |       Owner:  lsansonetti@…        
     Type:  defect               |      Status:  new                  
 Priority:  blocker              |   Milestone:                       
Component:  MacRuby              |    Keywords:                       
 The following code worked in 0.4
 framework 'Foundation'
 framework 'AudioToolbox'

 load_bridge_support_file '../BridgeSupport/MusicPlayer.bridgesupport'

 class MusicPlayer
   def initialize
     musicPlayer = Pointer.new_with_type '^{OpaqueMusicPlayer}'      # This
 should create a double pointer
     puts musicPlayer.type                                           # But
 it doesn't
     (result = NewMusicPlayer musicPlayer) == 0 or raise result.to_s
     @musicPlayer = musicPlayer[0]                                   #
 Causing problems here

 musicPlayer = MusicPlayer.new

 But it now generates the following error

 $ macruby x.rb
 x.rb:8:in `initialize': unrecognized runtime type `{OpaqueMusicPlayer}'
         from core:in `__new__:'
         from x.rb:1:in `<main>'

 The error is occuring during the attempt to dereference the double pointer
 at line 10 (despite the error message reporting line 8)

Ticket URL: <http://www.macruby.org/trac/ticket/376>
MacRuby <http://macruby.org/>

More information about the MacRuby-devel mailing list