aboutsummaryrefslogtreecommitdiff
path: root/src/core/lv_obj.h
diff options
context:
space:
mode:
authorLiam <30486941+liamHowatt@users.noreply.github.com>2024-08-13 11:58:03 -0400
committerGitHub <noreply@github.com>2024-08-13 23:58:03 +0800
commitcda2d609bbbd065d366ab8ff1509acf2634f4461 (patch)
treef3d63a817c4eacd0a4f358da825a61b84d86c90f /src/core/lv_obj.h
parent2d2a18b346516fa9ccdcfd65f124e99bc320170b (diff)
downloadlvgl-master.tar.gz
lvgl-master.zip
feat(obj): add lv_obj_null_on_delete (#6599)HEADmaster
Diffstat (limited to 'src/core/lv_obj.h')
-rw-r--r--src/core/lv_obj.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h
index 9d9eac9a0..3331d7570 100644
--- a/src/core/lv_obj.h
+++ b/src/core/lv_obj.h
@@ -375,6 +375,14 @@ const lv_obj_class_t * lv_obj_get_class(const lv_obj_t * obj);
*/
bool lv_obj_is_valid(const lv_obj_t * obj);
+/**
+ * Utility to set an object reference to NULL when it gets deleted.
+ * The reference should be in a location that will not become invalid
+ * during the object's lifetime, i.e. static or allocated.
+ * @param obj_ptr a pointer to a pointer to an object
+ */
+void lv_obj_null_on_delete(lv_obj_t ** obj_ptr);
+
#if LV_USE_OBJ_ID
/**
* Set an id for an object.