summaryrefslogtreecommitdiff
path: root/src/bin/main.c
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2013-12-02 16:28:17 +0200
committerYakov Goldberg <yakov.g@samsung.com>2013-12-02 17:47:02 +0200
commitb537cff4aa6188bef192a6801a94ac293fd005d0 (patch)
tree2844e4205690524a5565b3ef03add51626edc179 /src/bin/main.c
parent64f209307ca0d062c0f85d5b8790638ccf68ce53 (diff)
add callback, which will be called when all simulated objects are deleted
Diffstat (limited to 'src/bin/main.c')
-rw-r--r--src/bin/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 996a34b..3b3f66c 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -34,6 +34,13 @@ _generate(const char *filename, const char* path, const char *project)
34 return 0; 34 return 0;
35} 35}
36 36
37static void
38_population_zero_cb(Gui_Session *session, void *data EINA_UNUSED)
39{
40 ERR("Deleting session from cb");
41 session_del(session);
42}
43
37static int 44static int
38_simulate(const char *filename, const char *target_name) 45_simulate(const char *filename, const char *target_name)
39{ 46{
@@ -53,16 +60,13 @@ _simulate(const char *filename, const char *target_name)
53 * when simulated windows or target win will be closed. */ 60 * when simulated windows or target win will be closed. */
54 Gui_Session *session = simulator_ctx_call(ctx, target_name); 61 Gui_Session *session = simulator_ctx_call(ctx, target_name);
55 if (!session) goto end; 62 if (!session) goto end;
63 session_population_zero_cb_set(session, _population_zero_cb, NULL);
56 64
57 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 65 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
58 elm_run(); 66 elm_run();
59 elm_exit(); 67 elm_exit();
60 68
61end: 69end:
62 /* FIXME: session_del() is not called in callbacks when target is Desktop
63 * So force to delete it here.*/
64 if (!strcmp(target_name, "Desktop"))
65 session_del(session);
66 gui_context_del(ctx); 70 gui_context_del(ctx);
67 return 0; 71 return 0;
68} 72}