From f4a024712f8072b840d79c2df8c095cdd11566e2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 5 Jan 2008 18:17:23 +0000 Subject: [PATCH] call tr_close() on shutdown. --- wx/Makefile.am | 6 +++--- wx/xmission.cc | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wx/Makefile.am b/wx/Makefile.am index 94d1dd086..873d682a3 100644 --- a/wx/Makefile.am +++ b/wx/Makefile.am @@ -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 \ diff --git a/wx/xmission.cc b/wx/xmission.cc index e9464bd78..e6573f229 100755 --- a/wx/xmission.cc +++ b/wx/xmission.cc @@ -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;