summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 19:42:39 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 19:42:39 +0000
commit63bb78db26ed509e9b12b586bafeb81f8bce40a5 (patch)
tree48dc77004052c90a54225ff96c98a2ab7d04ee21
parent5fee6eb5af83fcbd311acc21fb394ebc5f9d0956 (diff)
downloadchromium_src-63bb78db26ed509e9b12b586bafeb81f8bce40a5.zip
chromium_src-63bb78db26ed509e9b12b586bafeb81f8bce40a5.tar.gz
chromium_src-63bb78db26ed509e9b12b586bafeb81f8bce40a5.tar.bz2
Fixes crash that occurred because we weren't correctly disposing of the
native HWND for buttons. BUG=9301 TEST=see bug Review URL: http://codereview.chromium.org/42609 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12481 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/views/controls/native_control_win.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/views/controls/native_control_win.cc b/chrome/views/controls/native_control_win.cc
index e8574f0..827f509 100644
--- a/chrome/views/controls/native_control_win.cc
+++ b/chrome/views/controls/native_control_win.cc
@@ -27,6 +27,14 @@ NativeControlWin::NativeControlWin() : HWNDView() {
}
NativeControlWin::~NativeControlWin() {
+ HWND hwnd = GetHWND();
+ if (hwnd) {
+ // Destroy the hwnd if it still exists. Otherwise we won't have shut things
+ // down correctly, leading to leaking and crashing if another message
+ // comes in for the hwnd.
+ Detach();
+ DestroyWindow(hwnd);
+ }
}
LRESULT NativeControlWin::ProcessMessage(UINT message, WPARAM w_param,