mac: Don't rely on autorelease to delete window delegate

When quiting while closing window, it will leave the window delegate out
of the autorelease pool and crash.

Fixes #881.
This commit is contained in:
Cheng Zhao 2015-03-25 18:51:29 +08:00
parent 9f9f772ff5
commit 62f9c3def0
2 changed files with 12 additions and 13 deletions

View file

@ -14,6 +14,8 @@
#include "base/memory/scoped_ptr.h"
#include "atom/browser/native_window.h"
@class AtomNSWindow;
@class AtomNSWindowDelegate;
@class FullSizeContentView;
class SkRegion;
@ -102,7 +104,8 @@ class NativeWindowMac : public NativeWindow {
// whehter we can drag.
void InstallDraggableRegionView();
base::scoped_nsobject<NSWindow> window_;
base::scoped_nsobject<AtomNSWindow> window_;
base::scoped_nsobject<AtomNSWindowDelegate> window_delegate_;
// The view that will fill the whole frameless window.
base::scoped_nsobject<FullSizeContentView> content_view_;