Hi,
This patch was merged to CVS with small modification. I tested
following code does not crash.
Thanks!
-----------
require 'osx/cocoa'
class Ctrl < OSX::NSObject
def applicationDidFinishLaunching(notification)
win = Window.alloc.initWithContentRect([0, 0, 100, 100],
:styleMask, OSX::NSTitledWindowMask + OSX::NSClosableWindowMask,
:backing, OSX::NSBackingStoreBuffered,
:defer, true)
puts win.frame
OSX::NSApplication.sharedApplication.terminate(self)
end
end
class Window < OSX::NSWindow
ns_overrides 'frame'
def frame
super_frame # => crash
end
end
app = OSX::NSApplication.sharedApplication
app.setDelegate(Ctrl.alloc.init)
app.run
-----------
Fri, Dec 23, 2005 11:11:37 AM, Jonathan Paisley wrote:
>Hello,
>
>When using ns_overrides on methods that return large values (e.g., an
>NSRect), a crash occurs since the native function implementation used
>doesn't handle the msgSend_stret hidden first argument.
>
>The attached patch resolves this issue by choosing between one of two
>implementations for the handle_ruby_method function.
>
>I haven't adjusted indentation in order to make the patch smaller and
>clearer, so some cleanup may be required after application.
>
>Cheers,
>Jonathan
>
--
kimura wataru
|