A few more issues found from Code Analysis in VS #1184

Closed
wants to merge 10 commits into
from
@@ -130,7 +130,7 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
LPGUID deviceGUID = NULL;
RPC_CSTR wszUuid = NULL;
- HRESULT hr;
+ HRESULT hr = E_FAIL;
std::list<DSDevice> DSDeviceList;
std::string deviceFriendlyName;
DirectSoundEnumerate(DSEnumCallback, &DSDeviceList);
@@ -149,7 +149,7 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
break;
}
}
- if (hr == RPC_S_OK) RpcStringFree(&wszUuid);
+ if (hr == RPC_S_OK) RpcStringFree(&wszUuid);
}
hr = DirectSoundCreate(deviceGUID, &m_pDSound, NULL);
@@ -280,14 +280,14 @@ void CGraphicContext::SetFullScreenVideo(bool bOnOff)
if(m_bFullScreenRoot)
{
if(m_bFullScreenVideo)
- g_graphicsContext.SetVideoResolution(g_renderManager.GetResolution());
+ SetVideoResolution(g_renderManager.GetResolution());
else if(g_guiSettings.m_LookAndFeelResolution > RES_DESKTOP)
- g_graphicsContext.SetVideoResolution(g_guiSettings.m_LookAndFeelResolution);
+ SetVideoResolution(g_guiSettings.m_LookAndFeelResolution);
else
- g_graphicsContext.SetVideoResolution(RES_DESKTOP);
+ SetVideoResolution(RES_DESKTOP);
}
else
- g_graphicsContext.SetVideoResolution(RES_WINDOW);
+ SetVideoResolution(RES_WINDOW);
#endif
Unlock();
@@ -783,7 +783,7 @@ bool CGraphicContext::ToggleFullScreenRoot ()
uiRes = newRes;
#if defined(HAS_VIDEO_PLAYBACK)
- if (g_graphicsContext.IsFullScreenVideo() || g_graphicsContext.IsCalibrating())
+ if (IsFullScreenVideo() || IsCalibrating())
{
/* we need to trick renderer that we are fullscreen already so it gives us a valid value */
m_bFullScreenRoot = true;
@@ -185,7 +185,7 @@ const CWebSocketFrame* CWebSocketV8::close(WebSocketCloseReason reason /* = WebS
m_state = WebSocketStateClosed;
CWebSocketFrame* frame = new CWebSocketFrame(WebSocketConnectionClose, data, length);
- delete data;
+ delete[] data;
return frame;
}
@@ -620,7 +620,7 @@ bool CRenderSystemDX::BeginRender()
if (!m_bRenderCreated)
return false;
- DWORD oldStatus = m_nDeviceStatus;
+ HRESULT oldStatus = m_nDeviceStatus;
if (m_useD3D9Ex)
{
m_nDeviceStatus = ((IDirect3DDevice9Ex*)m_pD3DDevice)->CheckDeviceState(m_hDeviceWnd);