aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-20 18:25:58 +1000
committerDavid Walter Seikel2014-05-20 18:25:58 +1000
commit315aaabbce6b2db52ff5796708b777b488fd848e (patch)
treeb58c92292cda35e4435b2448d61a654e30580c7d /src/extantz
parentClean up the server startup and connection a bit. (diff)
downloadSledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.zip
SledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.tar.gz
SledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.tar.bz2
SledjHamr-315aaabbce6b2db52ff5796708b777b488fd848e.tar.xz
The results of a session with valgrind.
I'm surprised that this highly experimental code, built with chewing gum and chicken wire, had so little problems, and most of those where leaks. The majority of problems reported are from external libraries.
Diffstat (limited to '')
-rw-r--r--src/extantz/Evas_3D_demo.c1
-rw-r--r--src/extantz/camera.c1
-rw-r--r--src/extantz/ephysics_demo.c5
-rw-r--r--src/extantz/extantz.c6
-rw-r--r--src/extantz/extantz.h1
-rw-r--r--src/extantz/scenri.c17
-rw-r--r--src/extantz/woMan.c2
7 files changed, 25 insertions, 8 deletions
diff --git a/src/extantz/Evas_3D_demo.c b/src/extantz/Evas_3D_demo.c
index fb6f03f..3dda9ef 100644
--- a/src/extantz/Evas_3D_demo.c
+++ b/src/extantz/Evas_3D_demo.c
@@ -456,7 +456,6 @@ void Evas_3D_Demo_add(globals *ourGlobals)
456 456
457void Evas_3D_Demo_fini(globals *ourGlobals) 457void Evas_3D_Demo_fini(globals *ourGlobals)
458{ 458{
459 eo_unref(ourGlobals->scene->image);
460 free(sphere_vertices); 459 free(sphere_vertices);
461 free(sphere_indices); 460 free(sphere_indices);
462} 461}
diff --git a/src/extantz/camera.c b/src/extantz/camera.c
index 83bf98a..b7a79d1 100644
--- a/src/extantz/camera.c
+++ b/src/extantz/camera.c
@@ -235,6 +235,7 @@ Evas_3D_Node *cameraAdd(Evas *evas, Scene_Data *scene, Evas_Object *image)
235// evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0) 235// evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0)
236 evas_3d_node_orientation_set(0.0, 0.0, 0.0, 1.0) 236 evas_3d_node_orientation_set(0.0, 0.0, 0.0, 1.0)
237 ); 237 );
238// eo_unref(camera);
238 239
239 eo_do(scene->root_node, evas_3d_node_member_add(result)); 240 eo_do(scene->root_node, evas_3d_node_member_add(result));
240 eo_do(scene->scene, evas_3d_scene_camera_node_set(result)); 241 eo_do(scene->scene, evas_3d_scene_camera_node_set(result));
diff --git a/src/extantz/ephysics_demo.c b/src/extantz/ephysics_demo.c
index 6ace8a0..a0bf4d0 100644
--- a/src/extantz/ephysics_demo.c
+++ b/src/extantz/ephysics_demo.c
@@ -34,7 +34,7 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals)
34 34
35 sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME); 35 sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME);
36 box1 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, 36 box1 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win,
37 elm_obj_image_file_set(strdup(buf), "blue-cube"), 37 elm_obj_image_file_set(buf, "blue-cube"),
38 evas_obj_size_set(70, 70), 38 evas_obj_size_set(70, 70),
39 evas_obj_position_set(ourGlobals->win_w / 2 - 80, ourGlobals->win_h - 200), 39 evas_obj_position_set(ourGlobals->win_w / 2 - 80, ourGlobals->win_h - 200),
40 evas_obj_visibility_set(EINA_TRUE) 40 evas_obj_visibility_set(EINA_TRUE)
@@ -49,10 +49,9 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals)
49 ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1); 49 ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1);
50 eo_unref(box1); 50 eo_unref(box1);
51 51
52
53 sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME); 52 sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME);
54 box2 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, 53 box2 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win,
55 elm_obj_image_file_set(strdup(buf), "purple-cube"), 54 elm_obj_image_file_set(buf, "purple-cube"),
56 evas_obj_size_set(70, 70), 55 evas_obj_size_set(70, 70),
57 evas_obj_position_set(ourGlobals->win_w / 2 + 10, ourGlobals->win_h - 200), 56 evas_obj_position_set(ourGlobals->win_w / 2 + 10, ourGlobals->win_h - 200),
58 evas_obj_visibility_set(EINA_TRUE) 57 evas_obj_visibility_set(EINA_TRUE)
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c
index ff418c0..fa38251 100644
--- a/src/extantz/extantz.c
+++ b/src/extantz/extantz.c
@@ -606,8 +606,6 @@ EAPI_MAIN int elm_main(int argc, char **argv)
606 ourGlobals.ee = ecore_evas_ecore_evas_get(ourGlobals.evas); // Only use this on Evas that was created with Ecore_Evas. 606 ourGlobals.ee = ecore_evas_ecore_evas_get(ourGlobals.evas); // Only use this on Evas that was created with Ecore_Evas.
607#endif 607#endif
608 608
609 evas_object_event_callback_add(ourGlobals.win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals);
610
611 // Get the screen size. 609 // Get the screen size.
612 elm_win_screen_size_get(ourGlobals.win, &ourGlobals.win_x, &ourGlobals.win_y, &ourGlobals.scr_w, &ourGlobals.scr_h); 610 elm_win_screen_size_get(ourGlobals.win, &ourGlobals.win_x, &ourGlobals.win_y, &ourGlobals.scr_w, &ourGlobals.scr_h);
613 ourGlobals.win_x = ourGlobals.win_x + (ourGlobals.scr_w / 3); 611 ourGlobals.win_x = ourGlobals.win_x + (ourGlobals.scr_w / 3);
@@ -616,6 +614,8 @@ EAPI_MAIN int elm_main(int argc, char **argv)
616 evas_object_move(ourGlobals.win, ourGlobals.win_x, ourGlobals.win_y); 614 evas_object_move(ourGlobals.win, ourGlobals.win_x, ourGlobals.win_y);
617 evas_object_resize(ourGlobals.win, ourGlobals.win_w, ourGlobals.win_h); 615 evas_object_resize(ourGlobals.win, ourGlobals.win_w, ourGlobals.win_h);
618 616
617 evas_object_event_callback_add(ourGlobals.win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals);
618
619 /* Our "layers". TODO - This is out of date, I should update it. 619 /* Our "layers". TODO - This is out of date, I should update it.
620 620
621 Elm win - our real main window 621 Elm win - our real main window
@@ -694,7 +694,9 @@ EAPI_MAIN int elm_main(int argc, char **argv)
694 694
695 if (ourGlobals.win) 695 if (ourGlobals.win)
696 { 696 {
697 ecore_animator_del(ourGlobals.animator);
697 Evas_3D_Demo_fini(&ourGlobals); 698 Evas_3D_Demo_fini(&ourGlobals);
699 scenriDel(ourGlobals.scene);
698 eo_unref(ourGlobals.tb); 700 eo_unref(ourGlobals.tb);
699 winFangDel(ourGlobals.mainWindow); 701 winFangDel(ourGlobals.mainWindow);
700 } 702 }
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h
index d77c764..a41f4e0 100644
--- a/src/extantz/extantz.h
+++ b/src/extantz/extantz.h
@@ -264,6 +264,7 @@ void Evas_3D_Demo_fini(globals *ourGlobals);
264Scene_Data *scenriAdd(Evas_Object *win); 264Scene_Data *scenriAdd(Evas_Object *win);
265Evas_3D_Node *cameraAdd(Evas *evas, Scene_Data *scene, Evas_Object *win); 265Evas_3D_Node *cameraAdd(Evas *evas, Scene_Data *scene, Evas_Object *win);
266Eina_Bool animateCamera(Scene_Data *scene); 266Eina_Bool animateCamera(Scene_Data *scene);
267void scenriDel(Scene_Data *scene);
267 268
268winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool save); 269winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool save);
269void filesShow(winFang *me, Evas_Smart_Cb func, void *data); 270void filesShow(winFang *me, Evas_Smart_Cb func, void *data);
diff --git a/src/extantz/scenri.c b/src/extantz/scenri.c
index eaec88e..0210a48 100644
--- a/src/extantz/scenri.c
+++ b/src/extantz/scenri.c
@@ -143,7 +143,20 @@ Scene_Data *scenriAdd(Evas_Object *win)
143 return scene; 143 return scene;
144} 144}
145 145
146void scenriDel(globals *ourGlobals) 146void scenriDel(Scene_Data *scene)
147{ 147{
148 eo_unref(ourGlobals->scene->image); 148 // TODO - I should probably free up all this Evas_3D stuff. Oddly Eo doesn't bitch about it, only valgrind.
149 // Eo bitches if they are unref'd here.
150 // So either Eo or valgrind bitches, depending on what I do. I'll leave them commented out, let valgrind bitch, and blame Evas_3D.
151// eo_unref(scene->light_node);
152// eo_unref(scene->light);
153
154 // TODO - Should have a separate cameraDel() for these.
155 free(scene->move);
156// eo_unref(scene->camera_node);
157
158 eo_unref(scene->image);
159 eo_unref(scene->scene);
160// eo_unref(scene->root_node);
161 free(scene);
149} 162}
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c
index 64df84c..ef10631 100644
--- a/src/extantz/woMan.c
+++ b/src/extantz/woMan.c
@@ -245,6 +245,7 @@ winFang *woMan_add(globals *ourGlobals)
245 viewer_gic->func.del = NULL; 245 viewer_gic->func.del = NULL;
246 for (i = 0; NULL != viewerTest[i][0]; i++) 246 for (i = 0; NULL != viewerTest[i][0]; i++)
247 { 247 {
248 // TODO - Should free this later, but this entire thing needs a rewrite anyway.
248 ezViewer *thisViewer = calloc(1, sizeof(ezViewer)); 249 ezViewer *thisViewer = calloc(1, sizeof(ezViewer));
249 250
250 if (thisViewer) 251 if (thisViewer)
@@ -265,6 +266,7 @@ winFang *woMan_add(globals *ourGlobals)
265 266
266 sprintf(buf, "%s/%s", elm_app_data_dir_get(), img3); 267 sprintf(buf, "%s/%s", elm_app_data_dir_get(), img3);
267 tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Viewers", _promote, tab_it); 268 tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Viewers", _promote, tab_it);
269 // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away.
268 tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Landmarks", _promote, tab_it); 270 tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Landmarks", _promote, tab_it);
269 tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Grids", _promote, tab_it); 271 tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Grids", _promote, tab_it);
270 elm_layout_box_append(me->win, WF_BOX, nf); 272 elm_layout_box_append(me->win, WF_BOX, nf);