call tr_close() on shutdown.

This commit is contained in:
Charles Kerr 2008-01-05 18:17:23 +00:00
parent 0a66cb5103
commit f4a024712f
2 changed files with 11 additions and 11 deletions

View File

@ -4,16 +4,16 @@ AM_CXXFLAGS = $(WX_CXXFLAGS)
SUBDIRS = images
bin_PROGRAMS = Xmission
bin_PROGRAMS = xmission
Xmission_SOURCES = \
xmission_SOURCES = \
speed-stats.cc \
filter.cc \
torrent-list.cc \
torrent-stats.cc \
xmission.cc
Xmission_LDADD = \
xmission_LDADD = \
$(top_builddir)/libtransmission/libtransmission.a \
$(top_builddir)/third-party/libevent/libevent.la \
$(top_builddir)/third-party/miniupnp/libminiupnp.a \

View File

@ -388,7 +388,8 @@ void MyFrame :: OnOpen( wxCommandEvent& WXUNUSED(event) )
}
bool MyApp::OnInit()
bool
MyApp :: OnInit( )
{
handle = tr_init( "wx" );
@ -690,17 +691,16 @@ MyFrame :: MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size
OnPulse( dummy );
}
void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
void
MyFrame :: OnExit( wxCommandEvent& WXUNUSED( event ) )
{
Enable( false );
foreach( torrents_v, myTorrents, it )
tr_torrentClose( *it );
myTorrents.clear( );
mySelectedTorrents.clear( );
ApplyCurrentFilter( );
myTorrents.clear ();
mySelectedTorrents.clear ();
ApplyCurrentFilter ();
tr_close( handle );
/* give the connections a max of 10 seconds to shut themselves down */
myExitTime = time(0) + 10;