Skip to content

Commit

Permalink
Merge pull request #722 from mjakeman/fix-warnings-finalize
Browse files Browse the repository at this point in the history
Fix warnings when finalizing with remaining child widgets
  • Loading branch information
oscfdezdz authored Nov 2, 2024
2 parents a463aca + 4015529 commit 2cdb6e2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/exm-comment-tile.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* exm-comment-tile.c
*
* Copyright 2022-2024 Matthew Jakeman <mjakeman26@outlook.co.nz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/

#include "exm-comment-tile.h"

#include <text-engine/format/import.h>
Expand Down Expand Up @@ -39,6 +59,12 @@ exm_comment_tile_new (ExmComment *comment)
static void
exm_comment_tile_finalize (GObject *object)
{
GtkWidget *child;
ExmCommentTile *self = (ExmCommentTile *)object;

child = gtk_widget_get_first_child (GTK_WIDGET (self));
gtk_widget_unparent (child);

G_OBJECT_CLASS (exm_comment_tile_parent_class)->finalize (object);
}

Expand Down
24 changes: 24 additions & 0 deletions src/exm-rating.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* exm-rating.c
*
* Copyright 2022-2024 Matthew Jakeman <mjakeman26@outlook.co.nz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/

#include "exm-rating.h"

#include <glib/gi18n.h>
Expand Down Expand Up @@ -34,8 +54,12 @@ exm_rating_new (void)
static void
exm_rating_finalize (GObject *object)
{
GtkWidget *child;
ExmRating *self = (ExmRating *)object;

child = gtk_widget_get_first_child (GTK_WIDGET (self));
gtk_widget_unparent (child);

G_OBJECT_CLASS (exm_rating_parent_class)->finalize (object);
}

Expand Down

0 comments on commit 2cdb6e2

Please sign in to comment.