From ravuya at gmail.com Tue Jun 12 21:46:14 2007 From: ravuya at gmail.com (mike stedman) Date: Tue, 12 Jun 2007 19:46:14 -0600 Subject: [Cocoa-sharp] SDL application won't quit Message-ID: <640a8b270706121846q73bf282bic444e9193f5adf4d@mail.gmail.com> Hi all, I recently tried building a Tao.Sdl application on OS X, and am required to use Cocoa# since SDL depends on it on OS X. This means I have to create an AutoreleasePool, otherwise the application complains and refuses to open a CGSWindow. Later, I discovered that the Application class can set up its own pool, so I'm using that for the time being. The problem is that when my program finishes at the end of the main() function, the application won't quit. I've macpacked it as a cocoa application, and the console just constantly emits messages along these lines: Runtime Performance: CacheHits: 0 CacheHitBadType: 0 ConstructorHits: 0 NativeToManagedHits: 0 ImplementMethodHits: 0 ConstructManagedObjectHits: 0 TypeWalks: 0 The code in question looks pretty much like this: public void Run() { Application.Init(); NSApplicationLoad(); Sdl.SDL_Init(Sdl.SDL_INIT_EVERYTHING); Sdl.SDL_SetVideoMode(640, 480, 32, flags); // Rest of program... I'm assuming that it releases itself, since Mono claims that Release() and Dispose() are not valid methods to call on an AutoreleasePool or Application. Even Environment.Exit won't quit the program, and I don't want to have to use Process.Kill. Any insight into what's going wrong? I've built Tao.Sdl applications that quit fine before. Thanks in advance. -- Mike http://rav.realitybytes.tk From peter at ipacs.hu Tue Jun 19 10:27:27 2007 From: peter at ipacs.hu (=?UTF-8?Q?Ipacs_P=C3=A9ter?=) Date: Tue, 19 Jun 2007 16:27:27 +0200 Subject: [Cocoa-sharp] use samples provided by the cocoa-sharp-0.9.1 tarball Message-ID: <6a86db250706190727y6ab3f069gdc584ac8ef3a88a3@mail.gmail.com> Hi there, I've downloaded the cocoa-sharp-0.9.1 tarball and found the samples dir. I've tried to build those samples but it seems I'm doing something wrong. That's how I build the stuff: mcs -pkg:cocoa-sharp -r:System.Drawing -out:ViewSample.exe ViewSample.cs macpack -m:2 -n:View -o:. -a:ViewSample.exe -r:View.nib After I execute the View.app I got an empty black box. If I run the ViewSample.exe I got a stack trace(see below). Could you help me out what's wrong here? Thanks, P [2007-09-19 04:06:35] Handling a mach exception. Stacktrace: at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipCreateFromXDrawable_linux (intptr,intptr,intptr&) <0x00004> at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipCreateFromXDrawable_linux (intptr,intptr,intptr&) <0xffffffff> at System.Drawing.Graphics.FromXDrawable (intptr,intptr) <0x00021> at System.Drawing.Graphics.FromHwnd (intptr) <0x00186> at CocoaSharp.Samples.SimpleView.Draw (Cocoa.Rect) <0x00071> at (wrapper runtime-invoke) CocoaSharp.Samples.SimpleView.runtime_invoke_void_Rect(object,intptr,intptr,intptr) <0xffffffff> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(object,object[]) <0x00004> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(object,object[]) <0xffffffff> at System.Reflection.MonoMethod.Invoke (object, System.Reflection.BindingFlags,System.Reflection.Binder,object[], System.Globalization.CultureInfo) <0x000ab> at System.MonoType.InvokeMember (string,System.Reflection.BindingFlags, System.Reflection.Binder,object,object[],System.Reflection.ParameterModifier [],System.Globalization.CultureInfo,string[]) <0x0045c> at System.Type.InvokeMember (string,System.Reflection.BindingFlags, System.Reflection.Binder,object,object[]) <0x00029> at Cocoa.Native.InvokeMethod (Cocoa.Object,string,object[]) <0x00058> at Cocoa.Native.ImplementMethod (intptr,intptr,Cocoa.StackPadding) <0x0087c> at (wrapper native-to-managed) Cocoa.Native.ImplementMethod(intptr,intptr, Cocoa.StackPadding) <0xffffffff> at (wrapper managed-to-native) System.Boolean_System.IntPtr_System.IntPtr_System.IntPtr_System.IntPtr_System.IntPtr.objc_msgSend(intptr,intptr,intptr,intptr,intptr) <0x00004> at (wrapper managed-to-native) System.Boolean_System.IntPtr_System.IntPtr_System.IntPtr_System.IntPtr_System.IntPtr.objc_msgSend(intptr,intptr,intptr,intptr,intptr) <0xffffffff> at (wrapper runtime-invoke) System.Object.runtime_invoke_bool_intptr_intptr_intptr_intptr_intptr(object,intptr,intptr,intptr) <0xffffffff> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(object,object[]) <0x00004> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(object,object[]) <0xffffffff> at System.Reflection.MonoMethod.Invoke (object, System.Reflection.BindingFlags,System.Reflection.Binder,object[], System.Globalization.CultureInfo) <0x000ab> at System.MonoType.InvokeMember (string,System.Reflection.BindingFlags, System.Reflection.Binder,object,object[],System.Reflection.ParameterModifier [],System.Globalization.CultureInfo,string[]) <0x0045c> at System.Type.InvokeMember (string,System.Reflection.BindingFlags, System.Reflection.Binder,object,object[]) <0x00029> at Cocoa.ObjCMessaging.objc_msgSend (intptr,string,System.Type,object[]) <0x0059d> at Cocoa.Bundle.LoadNib (string) <0x00208> at Cocoa.Application.LoadNib (string) <0x00049> at CocoaSharp.Samples.OpenGLViewSample.Main (string[]) <0x00017> at (wrapper runtime-invoke) System.Object.runtime_invoke_void_string[] (object,intptr,intptr,intptr) <0xffffffff> Abort trap -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070619/e3406030/attachment.html