From 157c25b9d6248ec49bb635a3ce453ce32fb8503e Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 26 Mar 2014 08:00:29 +0000 Subject: [PATCH] Core:/POP3: destructor now calls LogOff git-svn-id: svn://ultimatepp.org/upp/trunk@7100 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/POP3/POP3.cpp | 6 +++--- uppsrc/Core/POP3/src.tpp/Pop3$en-us.tpp | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/uppsrc/Core/POP3/POP3.cpp b/uppsrc/Core/POP3/POP3.cpp index 21e45f774..ddf18bf51 100644 --- a/uppsrc/Core/POP3/POP3.cpp +++ b/uppsrc/Core/POP3/POP3.cpp @@ -219,7 +219,8 @@ bool Pop3::Logout() if(IsOnline()) PutGet("QUIT\r\n"); LLOG(Format(t_("Closing connection to %s:%d."), host, port)); - Close(); + if(IsOpen()) + Close(); online = false; return true; } @@ -233,6 +234,5 @@ Pop3::Pop3() Pop3::~Pop3() { - if(IsOpen()) - Close(); + Logout(); } diff --git a/uppsrc/Core/POP3/src.tpp/Pop3$en-us.tpp b/uppsrc/Core/POP3/src.tpp/Pop3$en-us.tpp index 1e2b42499..252b36b0b 100644 --- a/uppsrc/Core/POP3/src.tpp/Pop3$en-us.tpp +++ b/uppsrc/Core/POP3/src.tpp/Pop3$en-us.tpp @@ -118,7 +118,8 @@ Returns true on success.&] [s5;:Pop3`:`:Logout`(`): [@(0.0.255) bool]_[* Logout]()&] [s2;%% Logout of and disconnect from the POP3 server. Messages marked for deletion will be permanently deleted from the server after -a successful logout. Returns true on success.&] +a successful logout. Returns true on success. Calling Logout +on mailbox that is not online does nothing.&] [s3; &] [s4; &] [s5;:Pop3`:`:IsOnline`(`)const: [@(0.0.255) bool]_[* IsOnline]()_[@(0.0.255) const]&] @@ -133,9 +134,12 @@ a successful logout. Returns true on success.&] [*@3 b]_`=_[@(0.0.255) true])&] [s2;%% Activates logging of POP3.&] [s3;%% &] -[ {{10000F(128)G(128)@1 [s0;%% [* Constructor detail]]}}&] -[s0; &] +[s4; &] [s5;:Pop3`:`:Pop3`(`): [* Pop3]()&] [s2;%% Default constructor.&] [s3; &] +[s4; &] +[s5;:Pop3`:`:`~Pop3`(`): [@(0.0.255) `~][* Pop3]()&] +[s2;%% Destructor calls Logout.&] +[s3; &] [s0;%% ]] \ No newline at end of file