netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=3e42056b88ead6afa592916f138214ba2102b4ae

commit 3e42056b88ead6afa592916f138214ba2102b4ae
Author: Alastair Poole <nets...@gmail.com>
Date:   Sun Sep 1 15:11:40 2019 +0100

    Tidying up
---
 src/ui.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/ui.c b/src/ui.c
index 248208d..361a273 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -140,11 +140,10 @@ _misc_view_update(Ui *ui, results_t *results)
  
        char buf[256];
        snprintf(buf, sizeof(buf), "Battery %d ", i);
-        if (results->power.have_ac)
+        if (results->power.have_ac && i == 0)
          strcat(buf, "(plugged in)");
 
         elm_object_text_set(frame, buf);
-
         evas_object_show(frame);
 
         progress = elm_progressbar_add(frame);
@@ -156,8 +155,13 @@ _misc_view_update(Ui *ui, results_t *results)
         evas_object_show(progress);
         elm_object_content_set(frame, progress);
         elm_box_pack_end(box, frame);
+
+       free(results->power.batteries[i]);
      }
 
+   if (results->power.batteries)
+     free(results->power.batteries);
+
    frame = elm_frame_add(box);
    evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, 0);
    evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

-- 


Reply via email to