summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/test/plugin/plugin_windowed_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/content/test/plugin/plugin_windowed_test.cc b/content/test/plugin/plugin_windowed_test.cc
index c0d6630..546ad21 100644
--- a/content/test/plugin/plugin_windowed_test.cc
+++ b/content/test/plugin/plugin_windowed_test.cc
@@ -130,10 +130,11 @@ LRESULT CALLBACK WindowedPluginTest::WindowProc(
PAINTSTRUCT ps;
HDC hdc = BeginPaint(window, &ps);
HBRUSH brush = CreateSolidBrush(RGB(255, 0, 0));
- SelectObject(hdc, brush);
+ HGDIOBJ orig = SelectObject(hdc, brush);
RECT r;
GetClientRect(window, &r);
Rectangle(hdc, 0, 0, r.right, r.bottom);
+ SelectObject(hdc, orig); // restore
DeleteObject(brush);
EndPaint(window, &ps);
}