summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-07-24 13:58:57 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-07-24 14:01:03 +0100
commit569b2fd86a398048478fbaf0850854afee5c1761 (patch)
tree29cc9d122d67850b1f6d02237764407d26ae3d55
parente945f0d19654d153a626ff6627d2bbf36191cef8 (diff)
ecore-evas-x no longer uses X windows after receiving a destroy event
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c17
3 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 0918441632..4e41710dd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-07-18 Mike Blumenkrantz
2
3 * Ecore-Evas: fix usage of underlying X window after it has received a destroy event
4
12013-07-22 Jiyoun Park 52013-07-22 Jiyoun Park
2 6
3 * Evas: fix infinite loop if app use ecore evas image 7 * Evas: fix infinite loop if app use ecore evas image
diff --git a/NEWS b/NEWS
index 014928678c..caf8ee5afe 100644
--- a/NEWS
+++ b/NEWS
@@ -340,6 +340,7 @@ Fixes:
340 * Ecore_Evas: 340 * Ecore_Evas:
341 - Fix build of Ecore_Evas_Extn on Solaris. 341 - Fix build of Ecore_Evas_Extn on Solaris.
342 - Fix many memory problems with ecore_evas_extn. 342 - Fix many memory problems with ecore_evas_extn.
343 - Fix usage of underlying X window after it has received a destroy event
343 * Ecore_X: 344 * Ecore_X:
344 - Fix possible memory corruption in xrandr EDID functions. 345 - Fix possible memory corruption in xrandr EDID functions.
345 - Fix x11 error sync issue with ecore_x_image_get(). 346 - Fix x11 error sync issue with ecore_x_image_get().
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 260ae40265..d4733d5d0f 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -95,6 +95,7 @@ struct _Ecore_Evas_Engine_Data_X11 {
95 void *visual; // store visual used to create pixmap 95 void *visual; // store visual used to create pixmap
96 unsigned long colormap; // store colormap used to create pixmap 96 unsigned long colormap; // store colormap used to create pixmap
97 } pixmap; 97 } pixmap;
98 Eina_Bool destroyed : 1; // X window has been deleted and cannot be used
98}; 99};
99 100
100static Ecore_Evas_Interface_X11 * _ecore_evas_x_interface_x11_new(void); 101static Ecore_Evas_Interface_X11 * _ecore_evas_x_interface_x11_new(void);
@@ -152,8 +153,9 @@ static void
152_ecore_evas_x_group_leader_unset(Ecore_Evas *ee) 153_ecore_evas_x_group_leader_unset(Ecore_Evas *ee)
153{ 154{
154 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data; 155 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
155 ecore_x_window_prop_property_del(ee->prop.window, 156 if (!edata->destroyed)
156 ECORE_X_ATOM_WM_CLIENT_LEADER); 157 ecore_x_window_prop_property_del(ee->prop.window,
158 ECORE_X_ATOM_WM_CLIENT_LEADER);
157 if (edata->leader == leader_win) 159 if (edata->leader == leader_win)
158 { 160 {
159 leader_ref--; 161 leader_ref--;
@@ -224,8 +226,8 @@ _ecore_evas_x_sync_set(Ecore_Evas *ee)
224 } 226 }
225 edata->sync_counter = 0; 227 edata->sync_counter = 0;
226 } 228 }
227 if (sync_counter != edata->sync_counter) 229 if ((!edata->destroyed) && (sync_counter != edata->sync_counter))
228 ecore_x_e_comp_sync_counter_set(ee->prop.window, edata->sync_counter); 230 ecore_x_e_comp_sync_counter_set(ee->prop.window, edata->sync_counter);
229} 231}
230 232
231static void 233static void
@@ -1259,12 +1261,15 @@ _ecore_evas_x_event_window_destroy(void *data EINA_UNUSED, int type EINA_UNUSED,
1259{ 1261{
1260 Ecore_Evas *ee; 1262 Ecore_Evas *ee;
1261 Ecore_X_Event_Window_Destroy *e; 1263 Ecore_X_Event_Window_Destroy *e;
1264 Ecore_Evas_Engine_Data_X11 *edata;
1262 1265
1263 e = event; 1266 e = event;
1264 ee = ecore_event_window_match(e->win); 1267 ee = ecore_event_window_match(e->win);
1265 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ 1268 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
1266 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 1269 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1270 edata = ee->engine.data;
1267 if (ee->func.fn_destroy) ee->func.fn_destroy(ee); 1271 if (ee->func.fn_destroy) ee->func.fn_destroy(ee);
1272 edata->destroyed = 1;
1268 _ecore_evas_x_sync_clear(ee); 1273 _ecore_evas_x_sync_clear(ee);
1269 ecore_evas_free(ee); 1274 ecore_evas_free(ee);
1270 return ECORE_CALLBACK_PASS_ON; 1275 return ECORE_CALLBACK_PASS_ON;
@@ -1649,7 +1654,8 @@ _ecore_evas_x_free(Ecore_Evas *ee)
1649 _ecore_evas_x_sync_set(ee); 1654 _ecore_evas_x_sync_set(ee);
1650 if (edata->win_shaped_input) 1655 if (edata->win_shaped_input)
1651 ecore_x_window_free(edata->win_shaped_input); 1656 ecore_x_window_free(edata->win_shaped_input);
1652 if (ee->prop.window) ecore_x_window_free(ee->prop.window); 1657 ecore_event_window_unregister(ee->prop.window);
1658 if (ee->prop.window && (!edata->destroyed)) ecore_x_window_free(ee->prop.window);
1653 if (edata->pmap) ecore_x_pixmap_free(edata->pmap); 1659 if (edata->pmap) ecore_x_pixmap_free(edata->pmap);
1654 if (edata->mask) ecore_x_pixmap_free(edata->mask); 1660 if (edata->mask) ecore_x_pixmap_free(edata->mask);
1655 if (edata->gc) ecore_x_gc_free(edata->gc); 1661 if (edata->gc) ecore_x_gc_free(edata->gc);
@@ -1658,7 +1664,6 @@ _ecore_evas_x_free(Ecore_Evas *ee)
1658 edata->mask = 0; 1664 edata->mask = 0;
1659 edata->gc = 0; 1665 edata->gc = 0;
1660 edata->damages = NULL; 1666 edata->damages = NULL;
1661 ecore_event_window_unregister(ee->prop.window);
1662 while (edata->win_extra) 1667 while (edata->win_extra)
1663 { 1668 {
1664 Ecore_X_Window *winp; 1669 Ecore_X_Window *winp;