From 7ff26ec2aef57714dcab523f8e8d4f2535d6fcfe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Mar 2000 18:46:55 +0000 Subject: [PATCH] wxFTP::Close() shouldn't hide base wxSocket function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/protocol/ftp.h | 4 ++-- src/common/ftp.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/wx/protocol/ftp.h b/include/wx/protocol/ftp.h index 459f2bfd6c..0e7e595315 100644 --- a/include/wx/protocol/ftp.h +++ b/include/wx/protocol/ftp.h @@ -32,8 +32,8 @@ public: bool Connect(wxSockAddress& addr, bool wait = TRUE); bool Connect(const wxString& host); - // [forcibly] close the connection - bool Close(bool force = FALSE); + // close the connection + virtual bool Close(); void SetUser(const wxString& user) { m_user = user; } void SetPassword(const wxString& passwd) { m_passwd = passwd; } diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 80c0e1a057..e9db032f8e 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -71,6 +71,11 @@ wxFTP::wxFTP() wxFTP::~wxFTP() { + if ( m_streaming ) + { + (void)Abort(); + } + Close(); } @@ -122,17 +127,12 @@ bool wxFTP::Connect(const wxString& host) return Connect(addr); } -bool wxFTP::Close(bool force) +bool wxFTP::Close() { if ( m_streaming ) { - if ( !force ) - { - m_lastError = wxPROTO_STREAMING; - return FALSE; - } - - (void)Abort(); + m_lastError = wxPROTO_STREAMING; + return FALSE; } if ( IsConnected() ) -- 2.45.2