diff options
author | Murray Cumming <murrayc@murrayc.com> | 2015-11-26 10:35:20 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2015-11-26 10:35:21 +0100 |
commit | 4a6af0af0ca49596109681819286af9a2b311cc3 (patch) | |
tree | de36c924940cfac4f69c6dd3239b09f3e60a1bd3 | |
parent | eb2117327fa1a74f3f44a4acd227a2c836c48b38 (diff) | |
download | glibmm-4a6af0af0ca49596109681819286af9a2b311cc3.tar.gz |
glibmm_mainloop test: Allocate a thread on the stack.
As suggested by Kjell Ahlstedt:
https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
-rw-r--r-- | tests/glibmm_mainloop/main.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/glibmm_mainloop/main.cc b/tests/glibmm_mainloop/main.cc index fab8575e..de1a7514 100644 --- a/tests/glibmm_mainloop/main.cc +++ b/tests/glibmm_mainloop/main.cc @@ -86,16 +86,13 @@ int main(int, char**) // Create a second thread. const std::thread::id first_thread_id = std::this_thread::get_id(); - std::thread* second_thread = - new std::thread(&thread_function, first_thread_id, first_mainloop); + std::thread second_thread(&thread_function, first_thread_id, first_mainloop); // Start the first main loop. first_mainloop->run(); // Wait until the second thread has finished. - second_thread->join(); - delete second_thread; - second_thread = nullptr; + second_thread.join(); if (is_owner) Glib::MainContext::get_default()->release(); |