Page 1 of 1

Properly Close browser on OSX [standard rendering]

PostPosted: Mon Mar 02, 2020 11:24 am
by joaoneves
Hi,

Using standard rendering I want to close the browser but not the hosting window.
I'm calling BrowserHost.CloseBrowser and the CefLifeSpanHandler.DoClose gets called (as expected).
To prevent the hosting window from being closed the DoClose returns true.
On Windows I also explicitly close the browser window through DestroyWindow (inside DoClose) and the auxiliary process goes away.
What about OSX? How do I properly get rid of the browser (auxiliary process remains alive)?

Re: Properly Close browser on OSX [standard rendering]

PostPosted: Mon Mar 02, 2020 11:33 am
by magreenblatt
On macOS you need to release the NSView hosting the browser. This is generally done by removing it from the parent NSWindow/NSView and making sure that you’ve kept no references via retain.

Re: Properly Close browser on OSX [standard rendering]

PostPosted: Wed Mar 04, 2020 7:59 am
by joaoneves
Thanks. That was it, wasn't properly removing the browser from its parent nsview.