diff --git a/plugins/zzogl-pg-cg/opengl/ZZoglCreate.cpp b/plugins/zzogl-pg-cg/opengl/ZZoglCreate.cpp index 8f60b9de84..d94ef26198 100644 --- a/plugins/zzogl-pg-cg/opengl/ZZoglCreate.cpp +++ b/plugins/zzogl-pg-cg/opengl/ZZoglCreate.cpp @@ -323,7 +323,8 @@ __forceinline bool LoadShadersFromDat() fseek(fres, 0, SEEK_SET); fread(s_lpShaderResources, s, 1, fres); s_lpShaderResources[s] = 0; - + fclose(fres); + return true; } diff --git a/plugins/zzogl-pg-cg/opengl/ZZoglShaders.cpp b/plugins/zzogl-pg-cg/opengl/ZZoglShaders.cpp index 23ecf9dfb5..b16f52ddcb 100644 --- a/plugins/zzogl-pg-cg/opengl/ZZoglShaders.cpp +++ b/plugins/zzogl-pg-cg/opengl/ZZoglShaders.cpp @@ -222,6 +222,7 @@ bool ZZshCreateOpenShadersFile() { fseek(fres, 0, SEEK_SET); fread(s_lpShaderResources, s, 1, fres); s_lpShaderResources[s] = 0; + fclose(fres); # endif // _WIN32 #else // NOT RELEASE_TO_PUBLIC # ifndef _WIN32 // NOT WINDOWS diff --git a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp index 7f985032fb..95b4032345 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp @@ -274,7 +274,8 @@ __forceinline bool LoadShadersFromDat() fprintf(stderr, "Failed to read ps2hw.dat. Corrupted file?\n"); s_lpShaderResources[s] = 0; - + fclose(fres); + return true; } diff --git a/plugins/zzogl-pg/opengl/ZZoglShaders.cpp b/plugins/zzogl-pg/opengl/ZZoglShaders.cpp index 25e83d310d..5216aa9163 100644 --- a/plugins/zzogl-pg/opengl/ZZoglShaders.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglShaders.cpp @@ -224,6 +224,7 @@ bool ZZshCreateOpenShadersFile() { if (fread(s_lpShaderResources, s, 1, fres) == 0) ZZLog::Error_Log("Cannot read ps2hw.dat in working directory."); s_lpShaderResources[s] = 0; + fclose(fres); # endif // _WIN32 #else // NOT RELEASE_TO_PUBLIC # ifndef _WIN32 // NOT WINDOWS