File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,4 +43,4 @@ target_include_directories(reactive PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
4343if (ENABLE_TESTING)
4444 enable_testing ()
4545 add_subdirectory (tests )
46- endif ()
46+ endif ()
Original file line number Diff line number Diff line change 33#include < reactive/Computation.h>
44
55#include " ComputationsImpl.h"
6+ #include " reactive/Deferrer.h"
67
78#include < cassert>
89
@@ -29,7 +30,13 @@ namespace Reactive
2930 {
3031 auto pThis = this ;
3132 std::swap (tl_currentComputation, pThis);
32- m_cb ();
33+ try
34+ {
35+ m_cb ();
36+ }
37+ catch (...)
38+ {
39+ }
3340 std::swap (tl_currentComputation, pThis);
3441 }
3542
@@ -61,6 +68,7 @@ namespace Reactive
6168
6269 void Computation::resolveDirtynessDownstream ()
6370 {
71+ Deferrer deferrer;
6472 for (const auto v : m_registeredVars)
6573 v->resolveDirtynessDownstream ();
6674 }
Original file line number Diff line number Diff line change 55
66#include < algorithm>
77#include < chrono>
8+ #include < iostream>
89
910namespace Reactive
1011{
@@ -25,7 +26,6 @@ namespace Reactive
2526
2627 auto cp = std::move (m_pending);
2728
28-
2929 while (true )
3030 {
3131 std::pair<Deferrable *, Computation *> lowestDepth = { nullptr , nullptr };
@@ -37,12 +37,14 @@ namespace Reactive
3737 auto newLowestDepth = s->getLowest (lowestDepth.second );
3838
3939 if (newLowestDepth != lowestDepth.second )
40- lowestDepth = {s.get (), newLowestDepth};
40+ lowestDepth = { s.get (), newLowestDepth };
4141 }
4242 }
4343
4444 if (lowestDepth.first && lowestDepth.second )
45+ {
4546 lowestDepth.first ->doDeferred (lowestDepth.second );
47+ }
4648 else
4749 break ;
4850 }
Original file line number Diff line number Diff line change @@ -35,8 +35,7 @@ namespace Reactive::Detail
3535
3636 void VarBase::onWriteAccess () const
3737 {
38- Deferrer deferer;
39-
38+ Deferrer deferrer;
4039 auto current = Computation::getCurrentComputation ();
4140
4241 m_computationsLocked = true ;
You can’t perform that action at this time.
0 commit comments