magreenblatt wrote:Shutdown on OS X is a mess (in my opinion) and I'm not sure there's a way to escape platform-specific code. I updated the cefclient/cefsimple examples recently to more correctly match the Chromium shutdown process and added some related comments in https://code.google.com/p/chromiumembed ... il?id=1203.
That looks so broken
Okay I am actually not using Cocoa, but ObjFW (https://github.com/Midar/objfw), which makes getting this right even more difficult. (I want to make a cross-platform ObjC app and I wanted to use a WebInterface to avoid frameworks like Qt or WxWidgets. Now the Cocoa-RunLoop gets again in the way...)
So what cefsimple is doing is overriding [NSApplication terminate];
Why is that important? Only for the Menu call? Or does that also gets called when you quit it from the Dock?
Anyway, thats not too important for the actual shutdown.
So whats happening then, if I understand that correctly, is that all Browsers are closed.
Already implemented that.
Then I should call cef_quit_message_loop and cef_shutdown from the on_before_close callback of the last browser window? I am currently doing that from the on_close callback, which causes a leak. I guess I need to move that?
Also ObjFW powers it's own runloop, but thats unimportant, if I call cef_shutdown, before exit() gets called by ObjFW, right?
Or is it a must, that the main function returns?
EDIT: Okay I moved the cef_shutdown call to the last browsers on_before_close() call and now get an Invalid Context Exception inside cef_shutdown....