Fix use of uninitialized GPU context memory in release builds.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 10 Jan 2019 19:03:05 +0000 (20:03 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 10 Jan 2019 19:03:05 +0000 (20:03 +0100)
Reported by valgrind, not sure it caused any real bugs.

source/blender/gpu/intern/gpu_context.cpp

index ce3eb64fa37e8c0e0fa252038af2eb26a920023b..9c41d232fb00abe7160bbf8f1aa6bea503d6d543 100644 (file)
@@ -80,12 +80,14 @@ struct GPUContext {
 #if TRUST_NO_ONE
        pthread_t thread; /* Thread on which this context is active. */
        bool thread_is_used;
+#endif
 
        GPUContext() {
+#if TRUST_NO_ONE
                thread_is_used = false;
+#endif
                current_fbo = 0;
        }
-#endif
 };
 
 #if defined(_MSC_VER) && (_MSC_VER == 1800)