# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1342689913 0 # Node ID d1f65efea6b1af843465bf24fdf3e19c38870806 # Parent f77b76c86d19775b7d5c0c3a70b5c450e1db2e02 Minor OS/2 cleanup while looking for a weird bug in dw_font_text_extents_get() while autosizing.... Make sure cleanup codepaths are the same as setup. diff -r f77b76c86d19 -r d1f65efea6b1 os2/dw.c --- a/os2/dw.c Thu Jul 19 06:01:30 2012 +0000 +++ b/os2/dw.c Thu Jul 19 09:25:13 2012 +0000 @@ -10450,7 +10450,7 @@ if(handle) { hps = _set_colors(handle); - height = _get_height(handle); + height = _get_height(handle); } else if(pixmap) { @@ -10464,7 +10464,7 @@ ptl.y = height - y - 1; GpiSetPel(hps, &ptl); - if(!pixmap) + if(handle) WinReleasePS(hps); } @@ -10486,7 +10486,7 @@ if(handle) { hps = _set_colors(handle); - height = _get_height(handle); + height = _get_height(handle); } else if(pixmap) { @@ -10504,8 +10504,8 @@ GpiMove(hps, &ptl[0]); GpiLine(hps, &ptl[1]); - if(!pixmap) - WinReleasePS(hps); + if(handle) + WinReleasePS(hps); } @@ -10587,7 +10587,7 @@ else WinDrawText(hps, -1, (PCH)text, &rcl, _internal_color(_foreground), _internal_color(_background), DT_VCENTER | DT_LEFT | DT_ERASERECT); - if(!pixmap) + if(handle) WinReleasePS(hps); } @@ -10627,7 +10627,7 @@ if(height) *height = aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y; - if(!pixmap) + if(handle) WinReleasePS(hps); } @@ -10692,7 +10692,7 @@ if ( flags & DW_DRAW_FILL ) GpiEndArea( hps ); } - if ( !pixmap ) + if(handle) WinReleasePS(hps); free( pptl ); } @@ -10716,7 +10716,7 @@ if(handle) { hps = _set_colors(handle); - thisheight = _get_height(handle); + thisheight = _get_height(handle); } else if(pixmap) { @@ -10734,7 +10734,7 @@ GpiMove(hps, &ptl[0]); GpiBox(hps, (flags & DW_DRAW_FILL) ? DRO_OUTLINEFILL : DRO_OUTLINE, &ptl[1], 0, 0); - if(!pixmap) + if(handle) WinReleasePS(hps); } @@ -10820,7 +10820,7 @@ GpiEndArea(hps); } - if(!pixmap) + if(handle) WinReleasePS(hps); } @@ -11160,7 +11160,7 @@ } else { - if(!destp) + if(dest) WinReleasePS(hpsdest); return DW_ERROR_GENERAL; } @@ -11196,9 +11196,9 @@ GpiBitBlt(hpsdest, hpssrc, count, ptl, ROP_SRCCOPY, BBO_IGNORE); } - if(!destp) + if(dest) WinReleasePS(hpsdest); - if(!srcp) + if(src) WinReleasePS(hpssrc); return DW_ERROR_NONE; }