Skip to content

Commit

Permalink
Adding (std::nothrow) to the new[] call
Browse files Browse the repository at this point in the history
  • Loading branch information
levitation committed Jul 22, 2024
1 parent f2c6907 commit e2066a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mods/classic-taskbar-background-fix.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ I would like to thank @Anixx for testing the mod during its development and illu

#include <map>
#include <mutex>
#include <new> //std::nothrow
#include <windowsx.h>
#include <uxtheme.h>

Expand Down Expand Up @@ -321,7 +322,7 @@ void ConditionalFillRect(HDC hdc, const RECT& rect, COLORREF oldColor, COLORREF
bmi.bmiHeader.biBitCount = 32; //32-bit color depth
bmi.bmiHeader.biCompression = BI_RGB;

COLORREF* pixels = new COLORREF[pixelCount];
COLORREF* pixels = new(std::nothrow) COLORREF[pixelCount];
if (!pixels) {
Wh_Log(L"Allocating pixels array failed");
}
Expand Down

0 comments on commit e2066a6

Please sign in to comment.