예제 #1
0
파일: icontainer.c 프로젝트: jcupitt/nip2
static void
icontainer_dispose( GObject *gobject )
{
	iContainer *icontainer;

	g_return_if_fail( gobject != NULL );
	g_return_if_fail( IS_ICONTAINER( gobject ) );

	icontainer = ICONTAINER( gobject );

#ifdef DEBUG
	printf( "icontainer_dispose: (%p) %s \"%s\"\n",
		icontainer,
		G_OBJECT_TYPE_NAME( icontainer ), 
		NN( IOBJECT( icontainer )->name ) );
#endif /*DEBUG*/

	icontainer_map( icontainer,
		(icontainer_map_fn) icontainer_child_remove, NULL, NULL );
	icontainer_child_remove( icontainer );

	G_OBJECT_CLASS( parent_class )->dispose( gobject );
}
예제 #2
0
파일: row.c 프로젝트: imclab/nip2
static void
row_dispose( GObject *gobject )
{
	Row *row = ROW( gobject );

#ifdef DEBUG_NEW
	/* Can't use row_name_print(), we may not have a parent.
	 */
	printf( "row_dispose: %s", NN( IOBJECT( row )->name ) );
	if( row->sym ) 
		printf( " (%s)", symbol_name( row->sym ) );
	printf( "\n" );
#endif /*DEBUG_NEW*/

	/* Reset state. Also see row_parent_remove().
	 */
	row_hide_dependents( row );
	if( row->expr )
		expr_error_clear( row->expr );
	if( row->top_col && row->top_col->last_select == row )
		row->top_col->last_select = NULL;
	row_deselect( row );

	/* Break all recomp links.
	 */
	slist_map( row->parents, (SListMapFn) row_link_break, row );
	slist_map( row->children, (SListMapFn) row_link_break_rev, row );
	g_assert( !row->parents && !row->children );
	(void) slist_map( row->recomp, (SListMapFn) row_dirty_clear, NULL );
	if( row->top_row )
		row->top_row->recomp_save = 
			g_slist_remove( row->top_row->recomp_save, row );
	IM_FREEF( g_slist_free, row->recomp_save );

	g_assert( !row->recomp );

	if( row->expr ) {
		g_assert( row->expr->row == row );

		/* If we're a local row, we will have a private expr 
		 * allocated for us. Junk it.
		 */
		if( row != row->top_row ) 
			icontainer_child_remove( ICONTAINER( row->expr ) );
		else {
			/* Top-level row, we were zapping the sym's expr.
			 * Break the link to it.
			 */
			row->expr->row = NULL;
			row->expr = NULL;
		}
	}

	/* Is this a top-level row? Kill the symbol too. Need to do this after
	 * sorting out row->expr, since otherwise killing the symbol will kill
	 * us again in turn.
	 */
	if( row == row->top_row ) 
		IDESTROY( row->sym );

	G_OBJECT_CLASS( parent_class )->dispose( gobject );
}