qwindowsxpstyle: Add std::nothrow to new
There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the throwing 'new' operator. However, since this function already can fail in other cases, the 'buf' pointer can be checked for nullptr after the nothrow new. Task-number: QTBUG-71156 Change-Id: Ibca5d672544d3980dd8890474e3e2fbf7443e05d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
b688c7e99a
commit
177577932e
|
|
@ -511,8 +511,8 @@ QRegion QWindowsXPStylePrivate::region(XPThemeData &themeData)
|
|||
if (numBytes == 0)
|
||||
return QRegion();
|
||||
|
||||
char *buf = new char[numBytes];
|
||||
if (buf == 0)
|
||||
char *buf = new (std::nothrow) char[numBytes];
|
||||
if (!buf)
|
||||
return QRegion();
|
||||
|
||||
RGNDATA *rd = reinterpret_cast<RGNDATA*>(buf);
|
||||
|
|
|
|||
Loading…
Reference in New Issue