summaryrefslogtreecommitdiff
path: root/cppe/demo/IceE/chat/ChatClientDlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cppe/demo/IceE/chat/ChatClientDlg.cpp')
-rw-r--r--cppe/demo/IceE/chat/ChatClientDlg.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/cppe/demo/IceE/chat/ChatClientDlg.cpp b/cppe/demo/IceE/chat/ChatClientDlg.cpp
index d1ebb899861..5219d9d1798 100644
--- a/cppe/demo/IceE/chat/ChatClientDlg.cpp
+++ b/cppe/demo/IceE/chat/ChatClientDlg.cpp
@@ -193,6 +193,28 @@ CChatClientDlg::OnInitDialog()
void
CChatClientDlg::OnCancel()
{
+ if(_chat)
+ {
+ //
+ // Clear the router.
+ //
+ assert(_router);
+ try
+ {
+ _router->destroySession();
+ }
+ catch(const Ice::ConnectionLostException&)
+ {
+ //
+ // Expected: the router closed the connection.
+ //
+ }
+ catch(const Ice::Exception& ex)
+ {
+ AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
+ }
+ }
+
_log->setHandle(0);
CDialog::OnCancel();
}