This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch eolian/improvements
in repository efl.
View the commit online.
commit 818feb141a70aa358f16cf72ba6ecea3836bf7f9
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 21 13:54:38 2026 -0600
eio: Efl.Io.Model's path is construction only
The path was documented as only possible during construction, and the
listing started from finalize reads it, but nothing refused a later
call: it would leak the previous path and leave the model listing a
directory other than the one it reports. Declare it @construct_only so
that the generated guard refuses it after finalize. path_set now
replaces the stringshare it holds and handles NULL, as it may be set
more than once while the object is built.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/eio/efl_io_model.c | 12 ++++++++++--
src/lib/eio/efl_io_model.eo | 5 ++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/lib/eio/efl_io_model.c b/src/lib/eio/efl_io_model.c
index 69fc385025..3ac4178847 100644
--- a/src/lib/eio/efl_io_model.c
+++ b/src/lib/eio/efl_io_model.c
@@ -1115,8 +1115,16 @@ _efl_io_model_efl_object_finalize(Eo *obj, Efl_Io_Model_Data *pd)
static void
_efl_io_model_path_set(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv, const char *path)
{
- char *sanitized = eina_file_path_sanitize(path);
- priv->path = eina_stringshare_add(sanitized);
+ char *sanitized;
+
+ if (!path)
+ {
+ eina_stringshare_replace(&priv->path, NULL);
+ return;
+ }
+
+ sanitized = eina_file_path_sanitize(path);
+ eina_stringshare_replace(&priv->path, sanitized);
free(sanitized);
}
diff --git a/src/lib/eio/efl_io_model.eo b/src/lib/eio/efl_io_model.eo
index 2970017796..3af7e5d119 100644
--- a/src/lib/eio/efl_io_model.eo
+++ b/src/lib/eio/efl_io_model.eo
@@ -36,13 +36,16 @@ class @beta Efl.Io.Model extends Efl.Loop_Model
@property path {
[[ Define the root path of a model.
]]
- set { [[ Only possible during construction. ]] }
+ set { }
get { }
values {
path: string @nullable; [[Root path of the model. Can be $null.]]
}
}
}
+ constructors {
+ .path @optional @construct_only;
+ }
implements {
Efl.Object.finalize;
Efl.Object.invalidate;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.