mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 23:58:54 +02:00
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:
@@ -340,6 +340,8 @@
|
|||||||
* - A `GError*` must be initialized to %NULL before passing its address
|
* - A `GError*` must be initialized to %NULL before passing its address
|
||||||
* to a function that can report errors.
|
* 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
|
* - "Piling up" errors is always a bug. That is, if you assign a
|
||||||
* new #GError to a `GError*` that is non-%NULL, thus overwriting
|
* new #GError to a `GError*` that is non-%NULL, thus overwriting
|
||||||
* the previous error, it indicates that you should have aborted
|
* the previous error, it indicates that you should have aborted
|
||||||
|
Reference in New Issue
Block a user