aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/efl_mono/libefl_mono_native_test.c
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-09-03 16:19:21 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-09-03 17:39:38 -0300
commit840613235de6cabb878aadc163b8a46f7fb4440b (patch)
tree5bf8653260304402f22f04eb3fae3b8b5a74c3f9 /src/tests/efl_mono/libefl_mono_native_test.c
parentecore_event: fix ecore event handler iterator range (diff)
downloadefl-840613235de6cabb878aadc163b8a46f7fb4440b.tar.gz
efl-csharp: Use value_new/free for wrapped values
Summary: Using malloc/free as it was used before would cause double frees and other issues when mixing with eina_values created from the value mempool inside Eina. Fixes https://phab.enlightenment.org/T7359 Reviewers: felipealmeida, vitor.sousa, segfaultxavi Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/T7359 Differential Revision: https://phab.enlightenment.org/D6958
Diffstat (limited to 'src/tests/efl_mono/libefl_mono_native_test.c')
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index caf7fd98a8..6a746abb92 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -3642,7 +3642,7 @@ void _test_testing_set_value_ptr(EINA_UNUSED Eo *obj, Test_Testing_Data *pd, Ein
free(pd->stored_value);
}
- pd->stored_value = malloc(sizeof(Eina_Value));
+ pd->stored_value = eina_value_new(EINA_VALUE_TYPE_INT);
eina_value_copy(value, pd->stored_value);
}
@@ -3662,7 +3662,7 @@ void _test_testing_set_value(EINA_UNUSED Eo *obj, Test_Testing_Data *pd, Eina_Va
if (pd->stored_value) {
eina_value_free(pd->stored_value);
} else {
- pd->stored_value = malloc(sizeof(Eina_Value));
+ pd->stored_value = eina_value_new(EINA_VALUE_TYPE_INT);
}
eina_value_copy(&value, pd->stored_value);
}
@@ -3688,7 +3688,7 @@ void _test_testing_clear_value(EINA_UNUSED Eo *obj, Test_Testing_Data *pd)
{
if (pd->stored_value) {
eina_value_free(pd->stored_value);
- free(pd->stored_value);
+ pd->stored_value = NULL;
}
}