From 5461fa88b98cccb32a4cf9fdba95bcff86b75ade Mon Sep 17 00:00:00 2001 From: arujjval Date: Sat, 8 Feb 2025 10:15:01 +0530 Subject: [PATCH] added automatic cleanup link in hacking.md --- CONTRIBUTING.md | 4 ++++ HACKING.md | 11 +++++++++++ README.md | 3 +++ 3 files changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 403efa9f..38f2e428 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,6 +64,10 @@ size, disability, ethnicity, gender identity and expression, level of experience nationality, personal appearance, race, religion, or sexual identity and orientation. +## About GNOME Calendar + +Learn more about GNOME Calendar by reading our [HACKING.md](HACKING.md) file. + ### Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, diff --git a/HACKING.md b/HACKING.md index 618ab5fb..d99d1dcb 100644 --- a/HACKING.md +++ b/HACKING.md @@ -132,6 +132,17 @@ foo_bar_do_somthing_sync (a, 1, object, data, &error); ``` +### Automatic Cleanup Variables + +GLib provides macros like `g_auto`, `g_autoptr`, and `g_autofree` for automatic +cleanup of variables when they go out of scope. + +Choose `g_auto` for non-pointer or stack-based types with custom cleanup, +`g_autoptr` for pointer types with type-specific cleanup functions, and +`g_autofree` for memory allocated with `g_malloc()` that should be freed using `g_free()`. + +For more details, visit the official documentation [here](https://docs.gtk.org/glib/auto-cleanup.html). + # Contributing guidelines See CONTRIBUTING.md file for the contribution guidelines, and the Code of Conduct diff --git a/README.md b/README.md index e91a9376..abaab1d3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ effort. [![Flatpak](https://flathub.org/api/badge?svg&locale=en)](https://flathub.org/apps/details/org.gnome.Calendar) +## Contributors Guide + +Check out our [CONTRIBUTING.md](CONTRIBUTING.md) and [HACKING.md](HACKING.md) for more details. ## Useful links