summaryrefslogtreecommitdiffstats
path: root/win/tkWinDraw.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-05-10 06:59:20 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-05-10 06:59:20 (GMT)
commitdefd945691ca07b4408357d7c911236d538b0cec (patch)
tree98664f99a969db14433a5a9bd11e6f37b7aeb12c /win/tkWinDraw.c
parentae887dc099e08cdfc59332f954de871227c36e08 (diff)
downloadtk-defd945691ca07b4408357d7c911236d538b0cec.zip
tk-defd945691ca07b4408357d7c911236d538b0cec.tar.gz
tk-defd945691ca07b4408357d7c911236d538b0cec.tar.bz2
Slightly better fix for [72de53dab2]: unreachable code after Tcl_Panic() in tkWinDraw.c
Diffstat (limited to 'win/tkWinDraw.c')
-rw-r--r--win/tkWinDraw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 97f7b33..531f06b 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -586,7 +586,9 @@ TkPutImage(
ckfree(infoPtr);
}
if (!bitmap) {
- Tcl_Panic("Fail to allocate bitmap");
+ DeleteDC(dcMem);
+ TkWinReleaseDrawableDC(d, dc, &state);
+ return BadValue;
}
bitmap = (HBITMAP)SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y,