Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d316c74

Browse filesBrowse files
authored
Merge pull request #13347 from meeseeksmachine/auto-backport-of-pr-13289-on-v3.0.x
Backport PR #13289 on branch v3.0.x (Fix unhandled C++ exception)
2 parents 6f0b80c + 46b8d34 commit d316c74
Copy full SHA for d316c74

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎src/_tkagg.cpp

Copy file name to clipboardExpand all lines: src/_tkagg.cpp
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
111111
destheight = (int)(y2 - y1);
112112
deststride = 4 * destwidth;
113113

114-
destbuffer = new agg::int8u[deststride * destheight];
115-
if (destbuffer == NULL) {
114+
try {
115+
destbuffer = new agg::int8u[deststride * destheight];
116+
}
117+
catch (std::bad_alloc) {
116118
TCL_APPEND_RESULT(interp, "could not allocate memory", (char *)NULL);
117119
return TCL_ERROR;
118120
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.