summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-09-07 11:36:18 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2015-09-07 11:36:18 +0200
commite08a7d7c9d934b023c461b31e5942800174bd2a6 (patch)
treeb818745e93394a2763d016a9106598c236034ff6 /src/examples
parentccc823e7370ff9afad30b70385f09bddcff9521c (diff)
ecore_example: Fixing memory leak.
Summary: Fixed a memory leak in this example. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: cedric, stefan_schmidt Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3010
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/ecore/ecore_compose_get_example.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/examples/ecore/ecore_compose_get_example.c b/src/examples/ecore/ecore_compose_get_example.c
index 4359cb07dc..d33140bc21 100644
--- a/src/examples/ecore/ecore_compose_get_example.c
+++ b/src/examples/ecore/ecore_compose_get_example.c
@@ -155,16 +155,21 @@ int main()
155 d = calloc(1, sizeof(Data)); 155 d = calloc(1, sizeof(Data));
156 156
157 if (!ecore_event_init()) 157 if (!ecore_event_init())
158 return 0; 158 goto ecore_event_init_fail;
159 159
160/******* end 3 : Ecore compose stuff *******/ 160/******* end 3 : Ecore compose stuff *******/
161 161
162 if (!ecore_evas_init()) 162 if (!ecore_evas_init())
163 return 0; 163 goto ecore_evas_init_fail;
164 164
165 ee = ecore_evas_new(NULL, 10, 10, 0, 0, NULL); 165 ee = ecore_evas_new(NULL, 10, 10, 0, 0, NULL);
166 if (!ee) 166 if (!ee)
167 return -1; 167 {
168 ecore_evas_shutdown();
169 ecore_event_shutdown();
170 free(d);
171 return -1;
172 }
168 ecore_evas_callback_delete_request_set(ee, _del); 173 ecore_evas_callback_delete_request_set(ee, _del);
169 174
170 evas = ecore_evas_get(ee); 175 evas = ecore_evas_get(ee);
@@ -185,8 +190,13 @@ int main()
185 190
186 ecore_main_loop_begin(); 191 ecore_main_loop_begin();
187 192
188 ecore_event_shutdown(); 193 ecore_evas_free(ee);
189 ecore_evas_shutdown(); 194 ecore_evas_shutdown();
190 195
196ecore_evas_init_fail:
197 ecore_event_shutdown();
198
199ecore_event_init_fail:
200 free(d);
191 return 0; 201 return 0;
192} 202}