diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2023-10-31 11:48:56 -0400 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2023-10-31 11:48:56 -0400 |
| commit | 62792753bb4df2515e5e2d8cc48bca568c5379fd (patch) | |
| tree | d9228c42e52fee4b952bac5b8640ba362c3b65fb /include/framework/scheduling/Epoch.h | |
| parent | 28b036025d35853e2ff4ad0bd0c581768f93ece0 (diff) | |
| download | dynamic-extension-62792753bb4df2515e5e2d8cc48bca568c5379fd.tar.gz | |
Epoch: Creating an epoch now takes references on buffers + versions
When an epoch is created using the constructor Epoch(Structure, Buffer),
it will call take_reference() on both.
This was necessary to ensure that the destructor doesn't fail, as it
releases references and fails if the refcnt is 0. It releases the user
of the object from the burden of manually taking references in this
situation.
Diffstat (limited to 'include/framework/scheduling/Epoch.h')
| -rw-r--r-- | include/framework/scheduling/Epoch.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/framework/scheduling/Epoch.h b/include/framework/scheduling/Epoch.h index 03cbb62..6bbf927 100644 --- a/include/framework/scheduling/Epoch.h +++ b/include/framework/scheduling/Epoch.h @@ -33,6 +33,8 @@ public: , m_structure(structure) , m_active_jobs(0) { + structure->take_reference(); + buff->take_reference(); m_buffers.push_back(buff); } |