Free memory when native window is closed.

This commit is contained in:
Cheng Zhao 2014-04-23 08:50:26 +08:00
Родитель a040a96652
Коммит 5a316c0c41
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -98,6 +98,10 @@ void Window::WillCloseWindow(bool* prevent_default) {
void Window::OnWindowClosed() {
Emit("closed");
// Free memory when native window is closed, the delete is delayed so other
// observers would not get a invalid pointer of NativeWindow.
base::MessageLoop::current()->DeleteSoon(FROM_HERE, window_.release());
}
void Window::OnWindowBlur() {