diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-12-27 18:34:51 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-12-27 18:34:51 +0100 |
commit | d57bd8450ed96196f11f7e7f024a75a182750632 (patch) | |
tree | d3f307542071c2ea81db67326150bab42d44ca43 /cpp/test/ios/controller | |
parent | CHANGELOG updates (diff) | |
download | ice-d57bd8450ed96196f11f7e7f024a75a182750632.tar.bz2 ice-d57bd8450ed96196f11f7e7f024a75a182750632.tar.xz ice-d57bd8450ed96196f11f7e7f024a75a182750632.zip |
Thread safe redirect for controller applications
Diffstat (limited to 'cpp/test/ios/controller')
-rw-r--r-- | cpp/test/ios/controller/Bundle/ControllerI.mm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cpp/test/ios/controller/Bundle/ControllerI.mm b/cpp/test/ios/controller/Bundle/ControllerI.mm index 8bcbbb84697..46cf7739c9f 100644 --- a/cpp/test/ios/controller/Bundle/ControllerI.mm +++ b/cpp/test/ios/controller/Bundle/ControllerI.mm @@ -109,6 +109,8 @@ namespace Ice::CommunicatorPtr _communicator; }; + + Test::StreamHelper streamRedirect; } ControllerHelperI::ControllerHelperI(id<ControllerView> controller, const string& dll, const StringSeq& args) : @@ -197,6 +199,11 @@ ControllerHelperI::run() return; } + if(_dll.find("client") != string::npos || _dll.find("collocated") != string::npos) + { + streamRedirect.setControllerHelper(this); + } + CREATE_HELPER_ENTRY_POINT createHelper = (CREATE_HELPER_ENTRY_POINT)sym; char** argv = new char*[_args.size() + 1]; for(unsigned int i = 0; i < _args.size(); ++i) @@ -206,8 +213,6 @@ ControllerHelperI::run() argv[_args.size()] = 0; try { - Test::StreamHelper streamHelper(this, - _dll.find("client") != string::npos || _dll.find("collocated") != string::npos); IceInternal::UniquePtr<Test::TestHelper> helper(createHelper()); helper->setControllerHelper(this); helper->run(static_cast<int>(_args.size()), argv); @@ -225,6 +230,11 @@ ControllerHelperI::run() } delete[] argv; + if(_dll.find("client") != string::npos || _dll.find("collocated") != string::npos) + { + streamRedirect.setControllerHelper(0); + } + CFBundleUnloadExecutable(handle); CFRelease(handle); } |