diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-19 19:33:30 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-19 19:33:30 +0000 |
commit | 6fe676ae6572a0289e2f33ade575ba852d0479c8 (patch) | |
tree | f302071c498d04f2efbad826231a91e0b4b15244 /base | |
parent | 0cb21b0739018fbc095dd0f1a47aacde20b79ec1 (diff) | |
download | chromium_src-6fe676ae6572a0289e2f33ade575ba852d0479c8.zip chromium_src-6fe676ae6572a0289e2f33ade575ba852d0479c8.tar.gz chromium_src-6fe676ae6572a0289e2f33ade575ba852d0479c8.tar.bz2 |
Fix crash that can occur if PumpOutPendingPaintMessages is called outside the context of MessagePump::Run.
R=jar
Review URL: http://codereview.chromium.org/3137
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/message_pump_win.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc index b67c00e..0b52e7b 100644 --- a/base/message_pump_win.cc +++ b/base/message_pump_win.cc @@ -84,6 +84,11 @@ void MessagePumpWin::DidProcessMessage(const MSG& msg) { } void MessagePumpWin::PumpOutPendingPaintMessages() { + // If we are being called outside of the context of Run, then don't try to do + // any work. + if (!state_) + return; + // Create a mini-message-pump to force immediate processing of only Windows // WM_PAINT messages. Don't provide an infinite loop, but do enough peeking // to get the job done. Actual common max is 4 peeks, but we'll be a little |