Skip to content

Commit

Permalink
Fixed a couple of crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Aug 28, 2016
1 parent 154589e commit 68ad3b4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Client/core/CCommandFuncs.cpp
Expand Up @@ -450,8 +450,11 @@ void CCommandFuncs::Test ( const char* szParameters )
CVARS_GET ( "nick", strNick );
if ( strNick == szParameters )
{
int* pData = NULL;
*pData = 0;
if ( FileExists ( CalcMTASAPath ( "debug.txt" ) ) )
{
int* pData = NULL;
*pData = 0;
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions Client/core/DXHook/CProxyDirect3D9.cpp
Expand Up @@ -717,6 +717,15 @@ bool CreateDeviceSecondCallCheck( HRESULT& hOutResult, IDirect3D9* pDirect3D, UI
return true;
}

// Also check for calls from other threads
if ( !IsMainThread () )
{
SString strMessage ( " Passing through call #%d to CreateDevice because not main thread", uiCreateCount );
WriteDebugEvent ( strMessage );
AddReportLog ( 8627, strMessage );
return true;
}

if ( ++uiCreateCount == 1 )
return false;
WriteDebugEvent ( SString ( " Passing through call #%d to CreateDevice", uiCreateCount ) );
Expand Down
4 changes: 2 additions & 2 deletions Client/core/Graphics/CRenderItem.EffectWrap.cpp
Expand Up @@ -1215,8 +1215,8 @@ SString CEffectWrapImpl::GetAnnotationNameAndValue( D3DXHANDLE hParameter, uint
D3DXPARAMETER_DESC AnnotDesc;
m_pD3DEffect->GetParameterDesc( hAnnotation, &AnnotDesc );
LPCSTR szAnnotValue;
m_pD3DEffect->GetString( hAnnotation, &szAnnotValue );
strOutValue = szAnnotValue;
if ( SUCCEEDED( m_pD3DEffect->GetString( hAnnotation, &szAnnotValue ) ) )
strOutValue = szAnnotValue;
return AnnotDesc.Name;
}

Expand Down

0 comments on commit 68ad3b4

Please sign in to comment.