From: barbieri Date: Fri, 23 Jan 2009 15:28:43 +0000 (+0000) Subject: buffer: reorder destroy-recreate sequence to avoid cache to be destroyed. X-Git-Tag: 2.0_alpha~240^2~2621 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a58905ea942f1d40e031b9688086228c73fb2a71;p=framework%2Fuifw%2Fevas.git buffer: reorder destroy-recreate sequence to avoid cache to be destroyed. users of buffer engine (ie: e_thumb_main.c) were broken since when they resize the canvas they would implicitly call engine->setup() again, which would destroy output and create it again. However the cache could be destroyed and images using it would be bogus. This does not happen if the process have other cache users, but e_thumb is just one canvas live at time. By reordering, we have the cache reference to go to 2 and then back to 1, not destroying it. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@38739 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/engines/buffer/evas_engine.c b/src/modules/engines/buffer/evas_engine.c index 1f9e611..bb8f535 100644 --- a/src/modules/engines/buffer/evas_engine.c +++ b/src/modules/engines/buffer/evas_engine.c @@ -135,8 +135,6 @@ eng_setup(Evas *e, void *in) Evas_Engine_Info_Buffer *info; info = (Evas_Engine_Info_Buffer *)in; - if (e->engine.data.output) - eng_output_free(e->engine.data.output); re = _output_setup(e->output.w, e->output.h, info->info.dest_buffer, @@ -149,6 +147,8 @@ eng_setup(Evas *e, void *in) info->info.color_key_b, info->info.func.new_update_region, info->info.func.free_update_region); + if (e->engine.data.output) + eng_output_free(e->engine.data.output); e->engine.data.output = re; if (!e->engine.data.output) return; if (!e->engine.data.context)