You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/26 13:33:06 UTC

(nuttx-apps) branch master updated: lvgldemo: should use nuttx_deinit to free all resources

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 0109ab39e lvgldemo: should use nuttx_deinit to free all resources
0109ab39e is described below

commit 0109ab39eced335f4c5fd698c09d7de6bc1e9f6f
Author: Neo Xu <ne...@gmail.com>
AuthorDate: Sat Oct 26 12:56:57 2024 +0800

    lvgldemo: should use nuttx_deinit to free all resources
    
    Memory leak can be detected when simply change the while(1) loop to exit. The lv_nuttx_deinit will free resources including display, input etc.
    
    Signed-off-by: Neo Xu <ne...@gmail.com>
---
 examples/lvgldemo/lvgldemo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c
index 15fb906b0..52d48ba7d 100644
--- a/examples/lvgldemo/lvgldemo.c
+++ b/examples/lvgldemo/lvgldemo.c
@@ -162,7 +162,7 @@ int main(int argc, FAR char *argv[])
 #endif
 
 demo_end:
-  lv_disp_remove(result.disp);
+  lv_nuttx_deinit(&result);
   lv_deinit();
 
   return 0;