Skip to content

Commit ebe55e2

Browse files
committed
Fixed a couple of crashes
1 parent c505da3 commit ebe55e2

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

MTA10/core/CCommandFuncs.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,11 @@ void CCommandFuncs::Test ( const char* szParameters )
450450
CVARS_GET ( "nick", strNick );
451451
if ( strNick == szParameters )
452452
{
453-
int* pData = NULL;
454-
*pData = 0;
453+
if ( FileExists ( CalcMTASAPath ( "debug.txt" ) ) )
454+
{
455+
int* pData = NULL;
456+
*pData = 0;
457+
}
455458
}
456459
}
457460
}

MTA10/core/CProxyDirect3D9.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,15 @@ bool CreateDeviceSecondCallCheck( HRESULT& hOutResult, IDirect3D9* pDirect3D, UI
717717
return true;
718718
}
719719

720+
// Also check for calls from other threads
721+
if ( !IsMainThread () )
722+
{
723+
SString strMessage ( " Passing through call #%d to CreateDevice because not main thread", uiCreateCount );
724+
WriteDebugEvent ( strMessage );
725+
AddReportLog ( 8627, strMessage );
726+
return true;
727+
}
728+
720729
if ( ++uiCreateCount == 1 )
721730
return false;
722731
WriteDebugEvent ( SString ( " Passing through call #%d to CreateDevice", uiCreateCount ) );

MTA10/core/CRenderItem.EffectWrap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,8 +1215,8 @@ SString CEffectWrapImpl::GetAnnotationNameAndValue( D3DXHANDLE hParameter, uint
12151215
D3DXPARAMETER_DESC AnnotDesc;
12161216
m_pD3DEffect->GetParameterDesc( hAnnotation, &AnnotDesc );
12171217
LPCSTR szAnnotValue;
1218-
m_pD3DEffect->GetString( hAnnotation, &szAnnotValue );
1219-
strOutValue = szAnnotValue;
1218+
if ( SUCCEEDED( m_pD3DEffect->GetString( hAnnotation, &szAnnotValue ) ) )
1219+
strOutValue = szAnnotValue;
12201220
return AnnotDesc.Name;
12211221
}
12221222

0 commit comments

Comments
 (0)