Re: [Gtk-osx-users] Crash on "Quit" in menu.



On Apr 12, 2011, at 10:21 AM, Mikkel Kruse Johnsen wrote:

> I can see that you are not much for C#, thats fine.
> 
> My patch is no more a no-op than other gtk_*_new, and many don't do anything, like GtkEntry:
> --
> GtkWidget*
> gtk_entry_new (void)
> {
>   return g_object_new (GTK_TYPE_ENTRY, NULL);
> }
> --
> The point is to make it easier and more consistent. And also easier to wrap.
> 
> Yes i realize that my problem is with mono, actually with all virtual languages. I can see the people using Python have the same problems, that "NSApplication terminate" is calling exit. So they don't have time to cleanup. Sorry if I wasted your time.
> 

Has nothing to do with C# in particular. There are thousands of computer languages, and dozens of independently maintained wrappers of Gtk. That's too much for a one-person-part-time project to support. Gnome officially supports C++ and Python, so that's what I support for wrappers. 

The term for your patch is "syntactic sugar". It accomplishes nothing besides saving some typing, and makes absolutely no difference for writing a wrapper... but it might make a difference for gobject-introspection, so I might do it for that.

Mono is another matter entirely. For one thing, it's not a "virtual language", it's a runtime framework (that can run several languages, of which C# is the most well known). It has it's own event loop which integrates with the OS's event loop. Gtk also has its own event loop (provided by GLib) which integrates with the OS's event loop -- and probably does so differently from the way mono does. Mixing the two is asking for trouble.

You might be able to fix your crash by getting your Mono layer to also handle either NSApplicationShouldTerminate or NSApplicationWillTerminate and do whatever cleanup it needs to do. You'll have to write some Cocoa (objective-c) code to do it, but it's not difficult. You can use the code in GtkApplicationNotify.c as a template. The hard part will be making sure that you don't have a race condition between the two event loops.

I don't think that has anything to do with Python code crashing at exit (if it does: test-integration.py doesn't, but it doesn't do much of anything, either). Python doesn't have its own event loop.

Regards,
John Ralls





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]