From dbfa9b5660fd8d52ea58e1a78fc387e88c0babb5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 3 Nov 2014 22:12:33 +0800 Subject: [PATCH] mac: Clean delegate before releasing window --- brightray/browser/mac/bry_inspectable_web_contents_view.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index a5f8a52281..9efe560afa 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -68,6 +68,7 @@ using namespace brightray; [devtools_window_ makeKeyAndOrderFront:nil]; } else { [[self window] makeKeyAndOrderFront:nil]; + [devtools_window_ setDelegate:nil]; [devtools_window_ close]; devtools_window_.reset(); } @@ -146,7 +147,6 @@ using namespace brightray; #pragma mark - NSWindowDelegate - (void)windowWillClose:(NSNotification*)notification { - [devtools_window_ setDelegate:nil]; inspectableWebContentsView_->inspectable_web_contents()->CloseDevTools(); }