diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-03-19 20:11:31 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-03-19 20:30:23 +0100 |
commit | a175977e1eb7fe63b2314dcfb3944e87889af455 (patch) | |
tree | 3f3302b89e2193db7d7706889e6ddb2c5c63fe93 /vcl/win | |
parent | a25fa1cb0266bb8461323b5d856c3c979d538114 (diff) |
dr.memory: Deleting a drawing object that is selected into DC.
Change-Id: I2b04152896cdd231cc9be4ab008bc57a65c840da
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/source/gdi/salnativewidgets-luna.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index 9b690db4311a..aedbf8987e56 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -475,12 +475,13 @@ static void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal ) // and a darker horizontal line under that HPEN hpen = CreatePen( PS_SOLID, 1, RGB( 0xb0, 0xb0, 0xb0 ) ); - SelectObject( hDC, hpen ); + HPEN hOrigPen = (HPEN) SelectObject(hDC, hpen); MoveToEx( hDC, rc.left, gradient_bottom, NULL ); LineTo( hDC, rc.right, gradient_bottom ); - DeleteObject( hpen ); + SelectObject(hDC, hOrigPen); + DeleteObject(hpen); } else { @@ -500,12 +501,13 @@ static void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal ) from_y = to_y = rc.top; HPEN hpen = CreatePen( PS_SOLID, 1, RGB( 0xb0, 0xb0, 0xb0 ) ); - SelectObject( hDC, hpen ); + HPEN hOrigPen = (HPEN) SelectObject(hDC, hpen); MoveToEx( hDC, from_x, from_y, NULL ); LineTo( hDC, to_x, to_y ); - DeleteObject( hpen ); + SelectObject(hDC, hOrigPen); + DeleteObject(hpen); } } } |