Skip to content

Commit bb83c4c

Browse files
author
Henry Hoegelow
committed
fix integration in nl c15 project
2 parents c35e22a + 6e66a39 commit bb83c4c

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ target_include_directories(reactive PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
4343
if (ENABLE_TESTING)
4444
enable_testing()
4545
add_subdirectory(tests)
46-
endif ()
46+
endif ()

src/Computation.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
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
}

src/Deferrer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <algorithm>
77
#include <chrono>
8+
#include <iostream>
89

910
namespace 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
}

src/Var.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)