Fix to make plugins work on windows (last system error code for

the thread wasn't getting reset). Somebody with more windows
saavy might want to check that this doesn't break other stuff.
This commit is contained in:
Chris Want
2003-02-14 03:24:45 +00:00
parent 76396efb14
commit 877a4859d6

View File

@@ -67,8 +67,15 @@ void *PIL_dynlib_find_symbol(PILdynlib* lib, char *symname) {
}
char *PIL_dynlib_get_error_as_string(PILdynlib* lib) {
int err= GetLastError();
int err;
/* if lib is NULL reset the last error code */
if (!lib) {
SetLastError(ERROR_SUCCESS);
return NULL;
}
err= GetLastError();
if (err) {
static char buf[1024];