gui/calendar-navigation-button: Fix memory leak
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/865>
This commit is contained in:
@@ -96,14 +96,19 @@ gcal_calendar_navigation_button_set_property (GObject *object,
|
|||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_ACTIVE_DATE:
|
case PROP_ACTIVE_DATE:
|
||||||
gcal_clear_date_time (&self->active_date);
|
{
|
||||||
self->active_date = g_date_time_ref (g_value_get_boxed (value));
|
g_autofree char *format = NULL;
|
||||||
/*
|
|
||||||
* Translators: %OB is the month name and %Y is the year.
|
gcal_clear_date_time (&self->active_date);
|
||||||
* More formats can be found on the doc:
|
self->active_date = g_date_time_ref (g_value_get_boxed (value));
|
||||||
* https://docs.gtk.org/glib/method.DateTime.format.html
|
/*
|
||||||
*/
|
* Translators: %OB is the month name and %Y is the year.
|
||||||
gtk_menu_button_set_label (self->button, g_date_time_format (self->active_date, _ ("%OB %Y")));
|
* More formats can be found on the doc:
|
||||||
|
* https://docs.gtk.org/glib/method.DateTime.format.html
|
||||||
|
*/
|
||||||
|
format = g_date_time_format (self->active_date, _ ("%OB %Y"));
|
||||||
|
gtk_menu_button_set_label (self->button, format);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ACTIVE:
|
case PROP_ACTIVE:
|
||||||
|
|||||||
Reference in New Issue
Block a user