Skip to content

Commit f62bea3

Browse files
authored
Fixed #1637 Merge pull request #1638 from stan-dev/bugfix/issue-1637
avoid random segfaults at program exit
2 parents 81248fd + d8f4326 commit f62bea3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stan/math/rev/core/init_chainablestack.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class ad_tape_observer : public tbb::task_scheduler_observer {
3333
observe(true); // activates the observer
3434
}
3535

36+
~ad_tape_observer() { observe(false); }
37+
3638
void on_scheduler_entry(bool worker) {
3739
std::lock_guard<std::mutex> thread_tape_map_lock(thread_tape_map_mutex_);
3840
const std::thread::id thread_id = std::this_thread::get_id();

0 commit comments

Comments
 (0)