fix gtk+ crash. reported, tracked, and patched by serge in ticket #512

This commit is contained in:
Charles Kerr 2007-12-01 20:07:53 +00:00
parent 1cd5a05fb3
commit e843d4869c
1 changed files with 8 additions and 12 deletions

View File

@ -349,18 +349,14 @@ tr_core_handle( TrCore * self )
static void
tr_core_insert( TrCore * self, TrTorrent * tor )
{
GtkTreeIter iter;
const tr_info * inf;
gtk_list_store_append( GTK_LIST_STORE( self->model ), &iter );
inf = tr_torrent_info( tor );
gtk_list_store_set( GTK_LIST_STORE( self->model ), &iter,
MC_NAME, inf->name,
MC_SIZE, inf->totalSize,
MC_HASH, inf->hashString,
MC_TORRENT, tor,
MC_ID, self->nextid,
-1);
const tr_info * inf = tr_torrent_info( tor );
gtk_list_store_insert_with_values( GTK_LIST_STORE( self->model ), NULL, 0,
MC_NAME, inf->name,
MC_SIZE, inf->totalSize,
MC_HASH, inf->hashString,
MC_TORRENT, tor,
MC_ID, self->nextid,
-1);
g_object_unref( tor );
self->nextid++;
}