[Mono-bugs] [Bug 650546] MonoMac crash with a binding using a callback
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Dec 1 22:29:03 EST 2010
https://bugzilla.novell.com/show_bug.cgi?id=650546
https://bugzilla.novell.com/show_bug.cgi?id=650546#c2
--- Comment #2 from Geoff Norton <gnorton at novell.com> 2010-12-02 03:29:01 UTC ---
I must have had a bad repo in #c1 since I dont see that any more. Simpler
repo:
Working ObjC:
#include <stdio.h>
#import <Cocoa/Cocoa.h>
#include <objc/runtime.h>
int main (int argc, char **argv) {
id f = objc_msgSend (objc_getClass ("NSEvent"), sel_registerName
("addGlobalMonitorForEventsMatchingMask:handler:"), (uint) 11, 0x0);
printf ("%p\n", f);
return 0;
}
Failing C#:
using System;
using System.Runtime.InteropServices;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
class T {
static void Main (string [] args) {
NSApplication.Init ();
objc_msgSend (Class.GetHandle ("NSEvent"), Selector.GetHandle
("addGlobalMonitorForEventsMatchingMask:handler:"), (uint) 11, IntPtr.Zero);
}
[DllImport ("/usr/lib/libobjc.dylib")]
extern static IntPtr objc_msgSend (IntPtr k, IntPtr s, uint mask,
IntPtr block);
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list