mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
2596919c58
Add g_auto() and g_autoptr() as helpers for declaring variables with automatic cleanup. Add some macros to help types define cleanup functions for themselves. Going forward it will be an expectation that people use this macro when creating a new type, even if they do not intend to use the auto-cleanup functionality for themselves. These new macros only work on GCC and clang, which is why we resisted adding them for so long. There exist many people who are only interested in writing programs for these compilers, however, and a similar API in libgsystem has proven to be extremely popular, so let's expose this functionality to an even wider audience. We ignore deprecation warnings when emitting the free functions, which seems suspicious. The reason that we do this is not because we want to call deprecated functions, but just the opposite: sometimes the free function will be an _unref() function that is only AVAILABLE_IN newer versions, and these warnings are also implemented as deprecation warnings. https://bugzilla.gnome.org/show_bug.cgi?id=743640 |
||
---|---|---|
.. | ||
reference | ||
debugging.txt | ||
macros.txt | ||
Makefile.am |