This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository evisum.
View the commit online.
commit bf2d437131ddf6f209b503bf75c7e97a04be753b
Author: Alastair Poole <[email protected]>
AuthorDate: Sun Mar 29 08:32:49 2026 +0100
fix another leak
---
src/bin/ui/evisum_ui_graph.c | 39 ++++++++++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 7 deletions(-)
diff --git a/src/bin/ui/evisum_ui_graph.c b/src/bin/ui/evisum_ui_graph.c
index 6db0590..0cfaf32 100644
--- a/src/bin/ui/evisum_ui_graph.c
+++ b/src/bin/ui/evisum_ui_graph.c
@@ -3,24 +3,49 @@
#include <math.h>
#define GRAPH_LINE_STROKE_WIDTH 1.5
+#define GRAPH_ROOT_DATA_KEY "evisum_ui_graph_root"
static Eina_Bool
_graph_target_valid(Evas_Object *graph_bg, Evas_Object *graph_vg) {
return graph_bg && graph_vg && evas_object_evas_get(graph_bg) && evas_object_evas_get(graph_vg);
}
+static void
+_graph_root_children_clear(Evas_Vg_Container *root) {
+ Eina_Iterator *it;
+ Eina_List *nodes = NULL;
+ Evas_Vg_Node *node;
+
+ if (!root) return;
+
+ it = evas_vg_container_children_get(root);
+ if (!it) return;
+
+ EINA_ITERATOR_FOREACH(it, node)
+ nodes = eina_list_append(nodes, node);
+
+ eina_iterator_free(it);
+
+ EINA_LIST_FREE(nodes, node)
+ efl_del(node);
+}
+
static Evas_Vg_Container *
_graph_root_reset(Evas_Object *graph_vg) {
- Evas_Vg_Container *root;
- Evas_Vg_Node *old_root = evas_object_vg_root_node_get(graph_vg);
+ Evas_Vg_Container *root = evas_object_data_get(graph_vg, GRAPH_ROOT_DATA_KEY);
+ Evas_Vg_Node *root_node;
- /* Detach previous root first; Evas owns VG roots attached to the object. */
- if (old_root) evas_object_vg_root_node_set(graph_vg, NULL);
+ root_node = evas_object_vg_root_node_get(graph_vg);
+ if (!root || (root_node != (Evas_Vg_Node *) root)) {
+ root = evas_vg_container_add(graph_vg);
+ if (!root) return NULL;
- root = evas_vg_container_add(graph_vg);
- if (!root) return NULL;
+ evas_object_vg_root_node_set(graph_vg, (Evas_Vg_Node *) root);
+ evas_object_data_set(graph_vg, GRAPH_ROOT_DATA_KEY, root);
+ return root;
+ }
- evas_object_vg_root_node_set(graph_vg, (Evas_Vg_Node *) root);
+ _graph_root_children_clear(root);
return root;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.