File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
cefpython/cef3/windows/binaries Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -211,19 +211,17 @@ def OnSize(self, event):
211211 cefpython .WindowUtils .OnSize (self .GetHandleForBrowser (), 0 , 0 , 0 )
212212
213213 def OnClose (self , event ):
214- if self .browser :
215- # Calling CloseBrowser will cause that OnClose event occurs again,
216- # so self.browser must be checked if non-empty.
217- self .browser .StopLoad ()
218- self .browser .CloseBrowser ()
219- # Remove all CEF browser references so that browser is closed
220- # cleanly. Otherwise there may be issues for example with cookies
221- # not being flushed to disk when closing app immediately
222- # (Issue 158).
223- del self .javascriptExternal .mainBrowser
224- del self .clientHandler .mainBrowser
225- del self .browser
226- self .Destroy ()
214+ # Remove all CEF browser references so that browser is closed
215+ # cleanly. Otherwise there may be issues for example with cookies
216+ # not being flushed to disk when closing app immediately
217+ # (Issue 158).
218+ del self .javascriptExternal .mainBrowser
219+ del self .clientHandler .mainBrowser
220+ del self .browser
221+
222+ # Destroy wx frame, this will complete the destruction of CEF browser
223+ self .Destroy ()
224+
227225 # In wx.chromectrl calling browser.CloseBrowser and/or self.Destroy
228226 # may cause crashes when embedding multiple browsers in tab
229227 # (Issue 107). In such case instead of calling CloseBrowser/Destroy
You can’t perform that action at this time.
0 commit comments