summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-14 18:00:24 +0900
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commit34e6e2d561a2ae864e4ac21ce99e79eadd4d11a5 (patch)
tree8ade2bd04c1940f97cd2e002e3bd9788e66c1447
parent62ae94ecfd36ee03a00a8a6b0aac75317fd6930a (diff)
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.
-rw-r--r--src/bin/test_glview.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/test_glview.c b/src/bin/test_glview.c
index ceaf7cc01..31c76cffe 100644
--- a/src/bin/test_glview.c
+++ b/src/bin/test_glview.c
@@ -624,7 +624,7 @@ test_glview(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
624 gldata_init(gld); 624 gldata_init(gld);
625 625
626 // add a Z-depth buffer to the window and try to use GL 626 // add a Z-depth buffer to the window and try to use GL
627 accel = elm_config_accel_preference_get(); 627 accel = eina_stringshare_add(elm_config_accel_preference_get());
628 elm_config_accel_preference_set("gl:depth"); 628 elm_config_accel_preference_set("gl:depth");
629 629
630 // new window - do the usual and give it a name, title and delete handler 630 // 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
633 633
634 // restore previous accel preference 634 // restore previous accel preference
635 elm_config_accel_preference_set(accel); 635 elm_config_accel_preference_set(accel);
636 eina_stringshare_del(accel);
636 637
637 bx = elm_box_add(win); 638 bx = elm_box_add(win);
638 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 639 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);