diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-03-15 20:05:31 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-03-15 20:05:31 +0100 |
commit | 2e4ba353940e5ee8344be331ac40d5da92030213 (patch) | |
tree | 7f6e25a432541202f2800bbe42b022cbfa3cbcdb | |
parent | ICE-8703 - Removing PHP_DEBUG config (diff) | |
download | ice-2e4ba353940e5ee8344be331ac40d5da92030213.tar.bz2 ice-2e4ba353940e5ee8344be331ac40d5da92030213.tar.xz ice-2e4ba353940e5ee8344be331ac40d5da92030213.zip |
Potential UWP fix to solve controller crashes (ICE-8713)
-rwxr-xr-x | cpp/src/Ice/Network.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Selector.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 8 | ||||
-rw-r--r-- | cpp/test/uwp/controller/ViewController.xaml.cpp | 4 |
4 files changed, 7 insertions, 13 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 9b08d7b9fc7..a04619e84e1 100755 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -900,7 +900,7 @@ IceInternal::NativeInfo::queueOperation(SocketOperation op, IAsyncOperation<unsi { AsyncInfo* info = getAsyncInfo(op); Windows::Foundation::AsyncStatus status = operation->Status; - if (status == Windows::Foundation::AsyncStatus::Completed) + if(status == Windows::Foundation::AsyncStatus::Completed) { // // NOTE: it's important to modify the count _before_ calling the completion handler diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp index e0c228ffcf9..52de030b469 100644 --- a/cpp/src/Ice/Selector.cpp +++ b/cpp/src/Ice/Selector.cpp @@ -118,10 +118,8 @@ Selector::finish(IceInternal::EventHandler* handler) #ifdef ICE_OS_UWP // If async operations are no longer pending, clear the completion handler to break // the cyclic reference count. - if(!handler->_started) - { - handler->getNativeInfo()->setCompletedHandler(nullptr); - } + assert(!handler->_started && !handler->_pending); + handler->getNativeInfo()->setCompletedHandler(nullptr); #endif handler->_registered = SocketOperationNone; handler->_finish = false; // Ensures that finished() is only called once on the event handler. diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 6d514a48891..e80c1bed13f 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -989,14 +989,6 @@ IceInternal::ThreadPool::startMessage(ThreadPoolCurrent& current) _workQueue->queue(new FinishedWorkItem(current._handler, false)); _selector.finish(current._handler.get()); } -#ifdef ICE_OS_UWP - // If async operations are no longer pending, clear the completion handler to break - // the cyclic reference count. - if(!current._handler->_started) - { - current._handler->getNativeInfo()->setCompletedHandler(nullptr); - } -#endif return false; } } diff --git a/cpp/test/uwp/controller/ViewController.xaml.cpp b/cpp/test/uwp/controller/ViewController.xaml.cpp index 62ae12cee92..db1756fb828 100644 --- a/cpp/test/uwp/controller/ViewController.xaml.cpp +++ b/cpp/test/uwp/controller/ViewController.xaml.cpp @@ -474,6 +474,10 @@ ViewController::Hostname_SelectionChanged(Platform::Object^, Windows::UI::Xaml:: void ViewController::println(const string& s) { + if(s.empty()) + { + return; + } this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler( [=]() { |