aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_glview.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-14 18:00:24 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-14 20:19:30 +0900
commit310f7d03210a6d8ada3b011beaed3d2448f56df9 (patch)
tree591aa0e45116839564532361aa4a69c89210912a /legacy/elementary/src/bin/test_glview.c
parenttoolbar: do not change align for "noicon" toolbar items (diff)
downloadefl-310f7d03210a6d8ada3b011beaed3d2448f56df9.tar.gz
elm_test: Fix bug in GLView test
Scenario: const char * accel = accel_get(); accel_set("gl:depth"); Now accel may not be valid anymore since the original Eina_Stringshare might have been destroyed. So there was no point in saving the const char * pointer. It was not valid after the call to set(). This is a bit confusing here. Returning char* would be clear: the caller would own the data.
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/bin/test_glview.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/legacy/elementary/src/bin/test_glview.c b/legacy/elementary/src/bin/test_glview.c
index ceaf7cc017..31c76cffe3 100644
--- a/legacy/elementary/src/bin/test_glview.c
+++ b/legacy/elementary/src/bin/test_glview.c
@@ -624,7 +624,7 @@ test_glview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
gldata_init(gld);
// add a Z-depth buffer to the window and try to use GL
- accel = elm_config_accel_preference_get();
+ accel = eina_stringshare_add(elm_config_accel_preference_get());
elm_config_accel_preference_set("gl:depth");
// new window - do the usual and give it a name, title and delete handler
@@ -633,6 +633,7 @@ test_glview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
// restore previous accel preference
elm_config_accel_preference_set(accel);
+ eina_stringshare_del(accel);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);