From b99aa05cbf1d5ecdf16deffacb932cb9251b0719 Mon Sep 17 00:00:00 2001 From: "ramapcsx2.code" Date: Sat, 25 Jan 2014 14:25:48 +0000 Subject: [PATCH] Small round of patches for various issues. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5830 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GPURenderer.h | 6 +++++- plugins/GSdx/GSThread.cpp | 1 + plugins/spu2-x/src/Debug.cpp | 3 ++- plugins/spu2-x/src/Windows/dsp.cpp | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GPURenderer.h b/plugins/GSdx/GPURenderer.h index 001854c6cf..5b51c68eac 100644 --- a/plugins/GSdx/GPURenderer.h +++ b/plugins/GSdx/GPURenderer.h @@ -123,11 +123,15 @@ protected: int maxcount = std::max(m_maxcount * 3 / 2, 10000); Vertex* vertices = (Vertex*)_aligned_malloc(sizeof(Vertex) * maxcount, 32); - if(m_vertices != NULL) + if (m_vertices != NULL && vertices != NULL) { memcpy(vertices, m_vertices, sizeof(Vertex) * m_maxcount); _aligned_free(m_vertices); } + else // very bad! + { + printf("GSdx: failed to allocate %d bytes for verticles. We will proceed to crash now.\n", sizeof(Vertex) * maxcount); + } m_vertices = vertices; m_maxcount = maxcount - 100; diff --git a/plugins/GSdx/GSThread.cpp b/plugins/GSdx/GSThread.cpp index 687b9d7dd2..976d8ea211 100644 --- a/plugins/GSdx/GSThread.cpp +++ b/plugins/GSdx/GSThread.cpp @@ -129,6 +129,7 @@ void GSThread::CloseThread() { if(WaitForSingleObject(m_hThread, 5000) != WAIT_OBJECT_0) { + printf("GSdx: WARNING: GSThread Thread did not close itself in time. Assuming hung. Terminating.\n"); TerminateThread(m_hThread, 1); } diff --git a/plugins/spu2-x/src/Debug.cpp b/plugins/spu2-x/src/Debug.cpp index 2a200444e0..edd78a64c4 100644 --- a/plugins/spu2-x/src/Debug.cpp +++ b/plugins/spu2-x/src/Debug.cpp @@ -207,8 +207,9 @@ void DoFullDump() } fprintf(dump,"#### END OF DUMP.\n\n"); } + fclose(dump); } - fclose(dump); + dump = fopen( "logs/effects.txt", "wt" ); if (dump) { diff --git a/plugins/spu2-x/src/Windows/dsp.cpp b/plugins/spu2-x/src/Windows/dsp.cpp index 2982dc38b8..075283283c 100644 --- a/plugins/spu2-x/src/Windows/dsp.cpp +++ b/plugins/spu2-x/src/Windows/dsp.cpp @@ -108,6 +108,7 @@ void DspCloseLibrary() running=false; if(WaitForSingleObject(hUpdateThread,1000)==WAIT_TIMEOUT) { + ConLog("SPU2-X: WARNING: DSP Thread did not close itself in time. Assuming hung. Terminating.\n"); TerminateThread(hUpdateThread,1); } }