Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Want <cwant@ualberta.ca>2003-02-14 06:24:45 +0300
committerChris Want <cwant@ualberta.ca>2003-02-14 06:24:45 +0300
commit877a4859d62cc02d35f422ba449181c995c6964b (patch)
tree51c1bf2d99162455a81f2364d287c2efa2419baa /source/blender/blenlib/intern/dynlib.c
parent76396efb14a8255369d3cda6ce2522b788ec6740 (diff)
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.
Diffstat (limited to 'source/blender/blenlib/intern/dynlib.c')
-rw-r--r--source/blender/blenlib/intern/dynlib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c
index b1d19f46c38..89c21a9af55 100644
--- a/source/blender/blenlib/intern/dynlib.c
+++ b/source/blender/blenlib/intern/dynlib.c
@@ -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];