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/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@solidangle.com>2015-11-23 20:20:32 +0300
committerBrecht Van Lommel <brecht@solidangle.com>2015-11-23 20:20:32 +0300
commit880258a0db0813d6a92a62622fe636c0e189badb (patch)
tree7ab2bd4f9e5668d4e92f184683be07e5a3a41d0c /intern
parentf021d97e8f3812ada6e1afa44557cb62c4df1f02 (diff)
Fix T46848: OpenNL crash on Windows due to uninintialized variables.
Diffstat (limited to 'intern')
-rw-r--r--intern/opennl/intern/opennl.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/intern/opennl/intern/opennl.cpp b/intern/opennl/intern/opennl.cpp
index 076dce3b807..446a1a38f0d 100644
--- a/intern/opennl/intern/opennl.cpp
+++ b/intern/opennl/intern/opennl.cpp
@@ -77,6 +77,24 @@ typedef struct {
#define NL_STATE_SYSTEM_SOLVED 5
struct NLContext {
+ NLContext()
+ {
+ state = NL_STATE_INITIAL;
+ n = 0;
+ m = 0;
+ sparse_solver = NULL;
+ nb_variables = 0;
+ nb_rhs = 1;
+ nb_rows = 0;
+ least_squares = false;
+ solve_again = false;
+ }
+
+ ~NLContext()
+ {
+ delete sparse_solver;
+ }
+
NLenum state;
NLuint n;
@@ -103,24 +121,11 @@ struct NLContext {
NLContext *nlNewContext(void)
{
- NLContext* result = new NLContext();
- result->state = NL_STATE_INITIAL;
- result->nb_rhs = 1;
- return result;
+ return new NLContext();
}
void nlDeleteContext(NLContext *context)
{
- context->M.resize(0, 0);
- context->MtM.resize(0, 0);
- context->b.clear();
- context->Mtb.clear();
- context->x.clear();
- context->variable.clear();
-
- delete context->sparse_solver;
- context->sparse_solver = NULL;
-
delete context;
}