solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit d272db56e666e80e9f14b7191368db4b814a7368
parent 49c064810e2be07d0f87677829521cb8380c85f1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 26 Apr 2017 15:57:21 +0200

Fix the on-shaded-shape-creation error handling

Diffstat:
Msrc/solstice_object.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/solstice_object.c b/src/solstice_object.c @@ -294,7 +294,7 @@ create_stl stl = solparser_get_shape_stl(solstice->parser, stl_id); ASSERT(str_cget(&stl->filename)); - res = sstl_create(NULL, solstice->allocator, 0, &tmp_stl); + res = sstl_create(NULL, solstice->allocator, 1, &tmp_stl); if(res != RES_OK) { fprintf(stderr, "Could not create a Solstice Solver STL shape.\n"); goto error; @@ -608,9 +608,9 @@ create_shaded_shape exit: return res; error: - if(*ssol_front) SSOL(material_ref_put(*ssol_front)); - if(*ssol_back) SSOL(material_ref_put(*ssol_back)); - if(*ssol_shape) SSOL(shape_ref_put(*ssol_shape)); + if(*ssol_front) SSOL(material_ref_put(*ssol_front)), *ssol_front = NULL; + if(*ssol_back) SSOL(material_ref_put(*ssol_back)), *ssol_back = NULL; + if(*ssol_shape) SSOL(shape_ref_put(*ssol_shape)), *ssol_shape = NULL; goto exit; }