summaryrefslogtreecommitdiff
path: root/test/initial_event_tests/initial_event_test_stop_service.cpp
diff options
context:
space:
mode:
authorDiogo Pedrosa <48529452+DiogoPedrozza@users.noreply.github.com>2023-03-03 11:17:22 +0000
committerGitHub <noreply@github.com>2023-03-03 11:17:22 +0000
commit11447b294a5ad4d8be08a466f769670aa7ed924a (patch)
tree75a04fb3c8cca73a377e707d577c74bcb329597a /test/initial_event_tests/initial_event_test_stop_service.cpp
parent44be74e9d2b432494a0634f997887684c71f187f (diff)
downloadvSomeIP-11447b294a5ad4d8be08a466f769670aa7ed924a.tar.gz
vsomeip 3.1.37.1 (#414)
Co-authored-by: Diogo Pedrosa <diogo.pedrosa@ctw.bmwgroup.com>
Diffstat (limited to 'test/initial_event_tests/initial_event_test_stop_service.cpp')
-rw-r--r--test/initial_event_tests/initial_event_test_stop_service.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/initial_event_tests/initial_event_test_stop_service.cpp b/test/initial_event_tests/initial_event_test_stop_service.cpp
index 83cd34c..465c837 100644
--- a/test/initial_event_tests/initial_event_test_stop_service.cpp
+++ b/test/initial_event_tests/initial_event_test_stop_service.cpp
@@ -35,6 +35,8 @@ public:
stop_thread_(std::bind(&initial_event_test_stop_service::wait_for_stop, this)),
called_other_node_(false) {
if (!app_->init()) {
+ offer_thread_.detach();
+ stop_thread_.detach();
ADD_FAILURE() << "Couldn't initialize application";
return;
}
@@ -72,8 +74,12 @@ public:
}
~initial_event_test_stop_service() {
- offer_thread_.join();
- stop_thread_.join();
+ if (offer_thread_.joinable()) {
+ offer_thread_.join();
+ }
+ if (stop_thread_.joinable()) {
+ stop_thread_.join();
+ }
}
void offer() {