labwc/include/common
John Lindgren 16c5373be5
Some checks failed
labwc.github.io / notify (push) Has been cancelled
tree-wide: use die_if_null() for wlr_scene alloc failures
wlr_scene_*_create() functions all allocate memory via calloc() and
return NULL if the allocation fails. Previously, the failures were
handled in any of 3 different ways:

 - sending a wayland protocol error
 - exiting labwc with an error
 - segfault (no NULL check at all)

Since labwc does not attempt to survive heap exhaustion in other
allocation paths (such as `znew`), it seems more consistent to use the
same die_if_null() check used in those paths to exit with an error.

For the three most common create() functions (tree, rect, buffer),
add small lab_wlr_ wrappers to common/scene-helpers.
2026-03-15 21:26:37 +00:00
..
array.h
border.h
box.h box: factor out box_center() 2025-12-02 14:57:41 +09:00
buf.h
dir.h
edge.h
fd-util.h
file-helpers.h
font.h
graphic-helpers.h
lab-scene-rect.h
list.h
macros.h
match.h
mem.h
node-type.h Use "cycle" instead of "osd" across the codebase 2025-11-30 16:20:16 +09:00
nodename.h
parse-bool.h
parse-double.h
scene-helpers.h tree-wide: use die_if_null() for wlr_scene alloc failures 2026-03-15 21:26:37 +00:00
set.h
spawn.h
string-helpers.h string-helpers: update comments for str_equal() 2026-02-04 19:14:51 +09:00
xml.h