summaryrefslogtreecommitdiff
path: root/src/modules/evas/model_loaders
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-07-06 13:26:15 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-07-06 13:26:15 -0700
commit005375176df750874820f2987ad48dfa67b44c31 (patch)
tree4055c4928900453681823f09ea298eae188c1563 /src/modules/evas/model_loaders
parent522b82b026e9233b0724beb697096ac53f148064 (diff)
evas: fix initialisation and shutdown of eet and eina by mesh loader and saver.
Diffstat (limited to 'src/modules/evas/model_loaders')
-rw-r--r--src/modules/evas/model_loaders/eet/evas_model_load_eet.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c
index c17e984..b3ae3ba 100644
--- a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c
+++ b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c
@@ -8,7 +8,7 @@
8#include "evas_common_private.h" 8#include "evas_common_private.h"
9#include "evas_private.h" 9#include "evas_private.h"
10 10
11void 11static void
12_set_geometry_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh, 12_set_geometry_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh,
13 Evas_Canvas3D_Mesh_Eet *eet_mesh) 13 Evas_Canvas3D_Mesh_Eet *eet_mesh)
14{ 14{
@@ -59,7 +59,7 @@ _set_geometry_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh,
59 evas_canvas3d_mesh_frame_vertex_data_unmap(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD); 59 evas_canvas3d_mesh_frame_vertex_data_unmap(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD);
60} 60}
61 61
62void 62static void
63_set_material_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh, 63_set_material_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh,
64 Evas_Canvas3D_Mesh_Eet *eet_mesh) 64 Evas_Canvas3D_Mesh_Eet *eet_mesh)
65{ 65{
@@ -86,6 +86,7 @@ evas_model_load_file_eet(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
86 Evas_Canvas3D_File_Eet* eet_file; 86 Evas_Canvas3D_File_Eet* eet_file;
87 Eet_Data_Descriptor *_file_descriptor; 87 Eet_Data_Descriptor *_file_descriptor;
88 88
89 eet_init();
89 90
90 _file_descriptor = _evas_canvas3d_eet_file_get(); 91 _file_descriptor = _evas_canvas3d_eet_file_get();
91 ef = eet_mmap(file); 92 ef = eet_mmap(file);
@@ -98,12 +99,13 @@ evas_model_load_file_eet(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
98 if (!eet_file || !eet_file->mesh || !eet_file->header) 99 if (!eet_file || !eet_file->mesh || !eet_file->header)
99 { 100 {
100 ERR("Failed to read model file"); 101 ERR("Failed to read model file");
101 _evas_canvas3d_eet_file_free(eet_file); 102 goto on_error;
102 return;
103 } 103 }
104 104
105 _set_geometry_to_mesh_from_eet_file(mesh, eet_file->mesh); 105 _set_geometry_to_mesh_from_eet_file(mesh, eet_file->mesh);
106 _set_material_to_mesh_from_eet_file(mesh, eet_file->mesh); 106 _set_material_to_mesh_from_eet_file(mesh, eet_file->mesh);
107 107
108 on_error:
108 _evas_canvas3d_eet_file_free(eet_file); 109 _evas_canvas3d_eet_file_free(eet_file);
110 eet_shutdown();
109} 111}