gtk: Free resources when closing window.
This commit is contained in:
parent
0c9aea3308
commit
3d267fc743
1 changed files with 6 additions and 4 deletions
|
@ -121,10 +121,7 @@ NativeWindowGtk::NativeWindowGtk(content::WebContents* web_contents,
|
||||||
}
|
}
|
||||||
|
|
||||||
NativeWindowGtk::~NativeWindowGtk() {
|
NativeWindowGtk::~NativeWindowGtk() {
|
||||||
ui::ActiveWindowWatcherX::RemoveObserver(this);
|
CloseImmediately();
|
||||||
|
|
||||||
if (window_)
|
|
||||||
gtk_widget_destroy(GTK_WIDGET(window_));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowGtk::Close() {
|
void NativeWindowGtk::Close() {
|
||||||
|
@ -132,7 +129,12 @@ void NativeWindowGtk::Close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowGtk::CloseImmediately() {
|
void NativeWindowGtk::CloseImmediately() {
|
||||||
|
if (window_ == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
NotifyWindowClosed();
|
NotifyWindowClosed();
|
||||||
|
ui::ActiveWindowWatcherX::RemoveObserver(this);
|
||||||
|
|
||||||
gtk_widget_destroy(GTK_WIDGET(window_));
|
gtk_widget_destroy(GTK_WIDGET(window_));
|
||||||
window_ = NULL;
|
window_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue