gerror: Document in the GError rules that stack allocation is bad

It means that extended error domains can’t be used.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2021-01-13 13:28:12 +00:00
parent 5f11206237
commit b2230cb3d1

View File

@ -340,6 +340,8 @@
* - A `GError*` must be initialized to %NULL before passing its address
* to a function that can report errors.
*
* - #GError structs must not be stack-allocated.
*
* - "Piling up" errors is always a bug. That is, if you assign a
* new #GError to a `GError*` that is non-%NULL, thus overwriting
* the previous error, it indicates that you should have aborted