summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-01-22 14:37:56 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-01-22 14:40:47 -0500
commit572ad97e3cbca3465b5aedbf14e7c78c66defaca (patch)
treebc5b4701a9063e05c3a4414edbdd312f8fedb07f
parent5517066735284e5dd2e0e80d4f51fcab2701bf15 (diff)
ee engines should not crash when re-setting the same title/name_class
@fix
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c1
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c19
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c20
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c2
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c1
5 files changed, 29 insertions, 14 deletions
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 2c0d724..f66b7be 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -325,6 +325,7 @@ _ecore_evas_title_set(Ecore_Evas *ee, const char *title)
325{ 325{
326 INF("ecore evas title set"); 326 INF("ecore evas title set");
327 327
328 if (eina_streq(ee->prop.title, title)) return;
328 if (ee->prop.title) free(ee->prop.title); 329 if (ee->prop.title) free(ee->prop.title);
329 ee->prop.title = NULL; 330 ee->prop.title = NULL;
330 if (title) ee->prop.title = strdup(title); 331 if (title) ee->prop.title = strdup(title);
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index e47283e..c028a94 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -688,6 +688,7 @@ _ecore_evas_drm_hide(Ecore_Evas *ee)
688static void 688static void
689_ecore_evas_drm_title_set(Ecore_Evas *ee, const char *title) 689_ecore_evas_drm_title_set(Ecore_Evas *ee, const char *title)
690{ 690{
691 if (eina_streq(ee->prop.title, title)) return;
691 if (ee->prop.title) free(ee->prop.title); 692 if (ee->prop.title) free(ee->prop.title);
692 ee->prop.title = NULL; 693 ee->prop.title = NULL;
693 if (title) ee->prop.title = strdup(title); 694 if (title) ee->prop.title = strdup(title);
@@ -696,12 +697,18 @@ _ecore_evas_drm_title_set(Ecore_Evas *ee, const char *title)
696static void 697static void
697_ecore_evas_drm_name_class_set(Ecore_Evas *ee, const char *n, const char *c) 698_ecore_evas_drm_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
698{ 699{
699 if (ee->prop.name) free(ee->prop.name); 700 if (!eina_streq(ee->prop.name, n))
700 if (ee->prop.clas) free(ee->prop.clas); 701 {
701 ee->prop.name = NULL; 702 if (ee->prop.name) free(ee->prop.name);
702 ee->prop.clas = NULL; 703 ee->prop.name = NULL;
703 if (n) ee->prop.name = strdup(n); 704 if (n) ee->prop.name = strdup(n);
704 if (c) ee->prop.clas = strdup(c); 705 }
706 if (!eina_streq(ee->prop.clas, c))
707 {
708 if (ee->prop.clas) free(ee->prop.clas);
709 ee->prop.clas = NULL;
710 if (c) ee->prop.clas = strdup(c);
711 }
705} 712}
706 713
707static void 714static void
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 568a02c..81278f3 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -1069,6 +1069,7 @@ _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
1069 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1069 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1070 1070
1071 if (!ee) return; 1071 if (!ee) return;
1072 if (eina_streq(ee->prop.title, title)) return;
1072 if (ee->prop.title) free(ee->prop.title); 1073 if (ee->prop.title) free(ee->prop.title);
1073 ee->prop.title = NULL; 1074 ee->prop.title = NULL;
1074 if (title) ee->prop.title = strdup(title); 1075 if (title) ee->prop.title = strdup(title);
@@ -1094,13 +1095,18 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *
1094 1095
1095 if (!ee) return; 1096 if (!ee) return;
1096 wdata = ee->engine.data; 1097 wdata = ee->engine.data;
1097 if (ee->prop.name) free(ee->prop.name); 1098 if (!eina_streq(ee->prop.name, n))
1098 if (ee->prop.clas) free(ee->prop.clas); 1099 {
1099 ee->prop.name = NULL; 1100 if (ee->prop.name) free(ee->prop.name);
1100 ee->prop.clas = NULL; 1101 ee->prop.name = NULL;
1101 if (n) ee->prop.name = strdup(n); 1102 if (n) ee->prop.name = strdup(n);
1102 if (c) ee->prop.clas = strdup(c); 1103 }
1103 1104 if (!eina_streq(ee->prop.clas, c))
1105 {
1106 if (ee->prop.clas) free(ee->prop.clas);
1107 ee->prop.clas = NULL;
1108 if (c) ee->prop.clas = strdup(c);
1109 }
1104 if (ee->prop.clas) 1110 if (ee->prop.clas)
1105 ecore_wl_window_class_name_set(wdata->win, ee->prop.clas); 1111 ecore_wl_window_class_name_set(wdata->win, ee->prop.clas);
1106} 1112}
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 88397c7..9333455 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -757,7 +757,7 @@ static void
757_ecore_evas_win32_title_set(Ecore_Evas *ee, const char *title) 757_ecore_evas_win32_title_set(Ecore_Evas *ee, const char *title)
758{ 758{
759 INF("ecore evas title set"); 759 INF("ecore evas title set");
760 760 if (eina_streq(ee->prop.title, title)) return;
761 if (ee->prop.title) free(ee->prop.title); 761 if (ee->prop.title) free(ee->prop.title);
762 ee->prop.title = NULL; 762 ee->prop.title = NULL;
763 if (title) ee->prop.title = strdup(title); 763 if (title) ee->prop.title = strdup(title);
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 81e6208..c5ad4f1 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -2898,6 +2898,7 @@ _ecore_evas_x_activate(Ecore_Evas *ee)
2898static void 2898static void
2899_ecore_evas_x_title_set(Ecore_Evas *ee, const char *t) 2899_ecore_evas_x_title_set(Ecore_Evas *ee, const char *t)
2900{ 2900{
2901 if (eina_streq(ee->prop.title, t)) return;
2901 if (ee->prop.title) free(ee->prop.title); 2902 if (ee->prop.title) free(ee->prop.title);
2902 ee->prop.title = NULL; 2903 ee->prop.title = NULL;
2903 if (!t) return; 2904 if (!t) return;