Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Feb 4, 2021
1 parent 0148096 commit 647506c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dxg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ VOID DXG_FillTree(HWND hwndTV)
hr = g_pD3D->GetDeviceCaps(iAdapter, devType, &caps);
if (FAILED(hr))
memset(&caps, 0, sizeof(caps));
pCapsCopy = new D3DCAPS9;
pCapsCopy = new (std::nothrow) D3DCAPS9;
if (!pCapsCopy)
continue;
*pCapsCopy = caps;
Expand Down
4 changes: 3 additions & 1 deletion dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,9 @@ namespace

if (SUCCEEDED(hr) && num > 0)
{
DXGI_MODE_DESC* pDescs = new DXGI_MODE_DESC[num];
auto pDescs = new (std::nothrow) DXGI_MODE_DESC[num];
if (!pDescs)
return E_OUTOFMEMORY;

hr = pOutput->GetDisplayModeList(fmt, flags, &num, pDescs);

Expand Down
1 change: 1 addition & 0 deletions dxview.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <ctime>
#include <cstdio>
#include <iterator>
#include <new>

#include "resource.h"

Expand Down

0 comments on commit 647506c

Please sign in to comment.