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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-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];