diff options
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/fullscreen_controller.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/fullscreen_controller.mm | 8 |
3 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 65f7b61..ceee615 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -318,7 +318,9 @@ [downloadShelfController_ exiting]; // Explicitly release |fullscreenController_| here, as it may call back to - // this BWC in |-dealloc|. + // this BWC in |-dealloc|. We are required to call |-exitFullscreen| before + // releasing the controller. + [fullscreenController_ exitFullscreen]; fullscreenController_.reset(); // Under certain testing configurations we may not actually own the browser. diff --git a/chrome/browser/cocoa/fullscreen_controller.h b/chrome/browser/cocoa/fullscreen_controller.h index 9161905..9d824b3 100644 --- a/chrome/browser/cocoa/fullscreen_controller.h +++ b/chrome/browser/cocoa/fullscreen_controller.h @@ -79,7 +79,9 @@ // mode. |-enterFullscreenForContentView:showDropdown:| should be called after // the fullscreen window is setup, just before it is shown. |-exitFullscreen| // should be called before any views are moved back to the non-fullscreen -// window. +// window. If |-enterFullscreenForContentView:showDropdown:| is called, it must +// be followed with a call to |-exitFullscreen| before the controller is +// released. - (void)enterFullscreenForContentView:(NSView*)contentView showDropdown:(BOOL)showDropdown; - (void)exitFullscreen; diff --git a/chrome/browser/cocoa/fullscreen_controller.mm b/chrome/browser/cocoa/fullscreen_controller.mm index 90186bd..74de909 100644 --- a/chrome/browser/cocoa/fullscreen_controller.mm +++ b/chrome/browser/cocoa/fullscreen_controller.mm @@ -142,8 +142,7 @@ const CGFloat kFloatingBarVerticalOffset = 22; - (void)showTimerFire:(NSTimer*)timer; - (void)hideTimerFire:(NSTimer*)timer; -// Stops any running animations, removes tracking areas, etc. Common cleanup -// code shared by |-exitFullscreen| and |-dealloc|. +// Stops any running animations, removes tracking areas, etc. - (void)cleanup; // Shows and hides the UI associated with this window being active (having main @@ -169,7 +168,7 @@ const CGFloat kFloatingBarVerticalOffset = 22; } - (void)dealloc { - [self cleanup]; + DCHECK(!isFullscreen_); [super dealloc]; } @@ -580,6 +579,9 @@ const CGFloat kFloatingBarVerticalOffset = 22; // since we will no longer be receiving actual status resignation // notifications. [self hideActiveWindowUI]; + + // No more calls back up to the BWC. + browserController_ = nil; } - (void)showActiveWindowUI { |