From 78fc05ac911c413b577e62d314819dbb980ec0bd Mon Sep 17 00:00:00 2001 From: Savio Sena Date: Wed, 22 Oct 2014 02:31:43 -0200 Subject: [PATCH] expedite-cxx: Fix deadlock. --- src/bin/cxx/font_effect_blur_color.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/bin/cxx/font_effect_blur_color.cc b/src/bin/cxx/font_effect_blur_color.cc index 18329d4..ebe9140 100644 --- a/src/bin/cxx/font_effect_blur_color.cc +++ b/src/bin/cxx/font_effect_blur_color.cc @@ -19,7 +19,7 @@ static int done = 0; extern int win_w, win_h; /* private data */ -static evas::text text; +static evas::text *text; static const int MAX_BLUR = 100; /* setup */ @@ -28,13 +28,13 @@ static void _setup(void) evas::canvas canvas(::eo_ref(G_evas)); int w, h; - evas::text o(efl::eo::parent = canvas); - o.evas::object::color_set(0, 0, 0, 255); - o.font_set("Vera-Bold", 80); - o.text_set("Font Effect"); - o.visibility_set(true); - o.evas::object::size_get(&w, &h); - o.evas::object::position_set((win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR); + evas::text *o = new evas::text(efl::eo::parent = canvas); + o->evas::object::color_set(0, 0, 0, 255); + o->font_set("Vera-Bold", 80); + o->text_set("Font Effect"); + o->visibility_set(true); + o->evas::object::size_get(&w, &h); + o->evas::object::position_set((win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR); text = o; done = 0; } @@ -42,7 +42,8 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { - ::eo_del(text._release()); + text->visibility_set(false); + delete text; } /* loop - do things */ @@ -53,7 +54,7 @@ static void _loop(double t, int f) char buf[256]; const char *str = "buffer:a(rgba);padding_set(%d);blend(dst=a,color=darkblue);blur(%d,src=a);"; sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1)); - text.filter_program_set(buf); + text->filter_program_set(buf); } FPS_STD(NAME); }