Merge pull request #5247 from unknownbrackets/callbacks

Work around a callback issue and a strange debug-only crash
This commit is contained in:
Henrik Rydgård 2014-01-27 08:03:25 -08:00
commit 1268bbd489
2 changed files with 7 additions and 0 deletions

View file

@ -2299,6 +2299,8 @@ void sceKernelExitDeleteThread(int exitStatus)
{
INFO_LOG(SCEKERNEL,"sceKernelExitDeleteThread(%d)", exitStatus);
__KernelDeleteThread(currentThread, exitStatus, "thread exited with delete");
// Temporary hack since we don't reschedule within callbacks.
g_inCbCount = 0;
hleReSchedule("thread exited with delete");
}

View file

@ -588,7 +588,12 @@ int ZEXPORT gzclose_r(file)
err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
gz_error(state, Z_OK, NULL);
free(state->path);
#ifdef _WIN32
// Strange crash in debug-only when using close() under MSVC 2010.
ret = _close(state->fd);
#else
ret = close(state->fd);
#endif
free(state);
return ret ? Z_ERRNO : err;
}