diff --git a/gtk/torrent-cell-renderer.c b/gtk/torrent-cell-renderer.c index 8296bff2c..c5e24b7e1 100644 --- a/gtk/torrent-cell-renderer.c +++ b/gtk/torrent-cell-renderer.c @@ -870,11 +870,12 @@ torrent_cell_renderer_get_property( GObject * object, } } +G_DEFINE_TYPE (TorrentCellRenderer, torrent_cell_renderer, GTK_TYPE_CELL_RENDERER) + static void torrent_cell_renderer_dispose( GObject * o ) { TorrentCellRenderer * r = TORRENT_CELL_RENDERER( o ); - GObjectClass * parent; if( r && r->priv ) { @@ -886,12 +887,9 @@ torrent_cell_renderer_dispose( GObject * o ) r->priv = NULL; } - parent = g_type_class_peek( g_type_parent( TORRENT_CELL_RENDERER_TYPE ) ); - parent->dispose( o ); + G_OBJECT_CLASS( torrent_cell_renderer_parent_class )->dispose( o ); } -G_DEFINE_TYPE (TorrentCellRenderer, torrent_cell_renderer, GTK_TYPE_CELL_RENDERER) - static void torrent_cell_renderer_class_init( TorrentCellRendererClass * klass ) { diff --git a/gtk/tr-core.c b/gtk/tr-core.c index fac748e97..53173af13 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -91,11 +91,12 @@ core_is_disposed( const TrCore * core ) return !core || !core->priv->sorted_model; } +G_DEFINE_TYPE (TrCore, tr_core, G_TYPE_OBJECT) + static void core_dispose( GObject * o ) { TrCore * core = TR_CORE( o ); - GObjectClass * parent = g_type_class_peek( g_type_parent( TR_CORE_TYPE ) ); if( core->priv->sorted_model != NULL ) { @@ -104,22 +105,19 @@ core_dispose( GObject * o ) core->priv->raw_model = NULL; } - parent->dispose( o ); + G_OBJECT_CLASS( tr_core_parent_class )->dispose( o ); } static void core_finalize( GObject * o ) { TrCore * core = TR_CORE( o ); - GObjectClass * parent = g_type_class_peek( g_type_parent( TR_CORE_TYPE ) ); g_string_chunk_free( core->priv->string_chunk ); - parent->finalize( o ); + G_OBJECT_CLASS( tr_core_parent_class )->finalize( o ); } -G_DEFINE_TYPE (TrCore, tr_core, G_TYPE_OBJECT) - static void tr_core_class_init( TrCoreClass * core_class ) {