From 5f2747cf59b005abe0922707073cb61e6b21493c Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 20 Apr 2018 13:40:18 +0200 Subject: [PATCH] Fix UWP Hello server to destroy the communicator --- cpp11/Ice/uwp/hello/server/MainPage.xaml.cpp | 12 ++++++++---- cpp11/Ice/uwp/hello/server/MainPage.xaml.h | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cpp11/Ice/uwp/hello/server/MainPage.xaml.cpp b/cpp11/Ice/uwp/hello/server/MainPage.xaml.cpp index bb72bbe35..e8f44f6c2 100644 --- a/cpp11/Ice/uwp/hello/server/MainPage.xaml.cpp +++ b/cpp11/Ice/uwp/hello/server/MainPage.xaml.cpp @@ -6,7 +6,7 @@ #include "pch.h" #include "MainPage.xaml.h" -#include "Hello.h" +#include using namespace std; using namespace hello; @@ -49,10 +49,14 @@ class HelloI : public Hello }, CallbackContext::Any)); } - virtual void - shutdown(const Ice::Current&) + void shutdown(const ::Ice::Current& current) { - Application::Current->Exit(); + _page->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, + ref new DispatchedHandler([=]() + { + current.adapter->getCommunicator()->destroy(); + App::Current->Exit(); + }, CallbackContext::Any)); } private: diff --git a/cpp11/Ice/uwp/hello/server/MainPage.xaml.h b/cpp11/Ice/uwp/hello/server/MainPage.xaml.h index 80242b00a..16e218a85 100644 --- a/cpp11/Ice/uwp/hello/server/MainPage.xaml.h +++ b/cpp11/Ice/uwp/hello/server/MainPage.xaml.h @@ -8,7 +8,6 @@ #include "MainPage.g.h" #include -#include namespace hello {