mirror of
https://github.com/transmission/transmission
synced 2025-01-31 11:23:40 +00:00
fix a couple more minor leaks
This commit is contained in:
parent
737a5c7b5c
commit
101307ddff
5 changed files with 14 additions and 3 deletions
|
@ -152,6 +152,7 @@ removeTorrents( struct DeleteData * data )
|
|||
for( l=data->torrents; l!=NULL; l=l->next )
|
||||
tr_core_remove_torrent( data->core, l->data, data->delete_files );
|
||||
g_slist_free( data->torrents );
|
||||
data->torrents = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,6 +167,7 @@ removeResponse( GtkDialog * dialog, gint response, gpointer gdata )
|
|||
g_slist_foreach( data->torrents, (GFunc)g_object_unref, NULL );
|
||||
|
||||
gtk_widget_destroy( GTK_WIDGET( dialog ) );
|
||||
g_slist_free( data->torrents );
|
||||
g_free( data );
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ MakeMetaUI;
|
|||
static void
|
||||
freeMetaUI( gpointer p )
|
||||
{
|
||||
MakeMetaUI * ui = (MakeMetaUI *) p;
|
||||
MakeMetaUI * ui = p;
|
||||
tr_metaInfoBuilderFree( ui->builder );
|
||||
memset( ui, ~0, sizeof(MakeMetaUI) );
|
||||
g_free( ui );
|
||||
|
|
|
@ -167,7 +167,7 @@ tr_metaInfoBuilderCreate( tr_handle * handle, const char * topFile )
|
|||
void
|
||||
tr_metaInfoBuilderFree( tr_metainfo_builder * builder )
|
||||
{
|
||||
if( builder != NULL )
|
||||
if( builder )
|
||||
{
|
||||
uint32_t i;
|
||||
for( i=0; i<builder->fileCount; ++i )
|
||||
|
@ -482,6 +482,12 @@ tr_makeMetaInfo( tr_metainfo_builder * builder,
|
|||
{
|
||||
tr_lock * lock;
|
||||
|
||||
/* free any variables from a previous run */
|
||||
tr_free( builder->announce );
|
||||
tr_free( builder->comment );
|
||||
tr_free( builder->outputFile );
|
||||
|
||||
/* initialize the builder variables */
|
||||
builder->abortFlag = 0;
|
||||
builder->isDone = 0;
|
||||
builder->announce = tr_strdup( announce );
|
||||
|
|
|
@ -474,7 +474,6 @@ tr_getConfigDir( const tr_handle * handle )
|
|||
return handle->configDir;
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
tr_getTorrentDir( const tr_handle * handle )
|
||||
{
|
||||
|
|
|
@ -415,6 +415,7 @@ deadlineReached( const uint64_t deadline )
|
|||
void
|
||||
tr_close( tr_handle * h )
|
||||
{
|
||||
int i;
|
||||
const int maxwait_msec = SHUTDOWN_MAX_SECONDS * 1000;
|
||||
const uint64_t deadline = tr_date( ) + maxwait_msec;
|
||||
|
||||
|
@ -430,6 +431,9 @@ tr_close( tr_handle * h )
|
|||
|
||||
tr_fdClose( );
|
||||
tr_lockFree( h->lock );
|
||||
for( i=0; i<h->metainfoLookupCount; ++i )
|
||||
tr_free( h->metainfoLookup[i].filename );
|
||||
tr_free( h->metainfoLookup );
|
||||
tr_free( h->tag );
|
||||
tr_free( h->configDir );
|
||||
tr_free( h->resumeDir );
|
||||
|
|
Loading…
Reference in a new issue