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 {