OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / dc2211d

Clean up temporary scratch spaces
dc2211d97e59163a342224d04cb1fe56f799f468
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-21T22:17:09.000Z

Changed files (4) +12 -1

opencog/atoms/join/JoinLink.cc +2 -0
……@@ -354,6 +354,7 @@ HandleSet JoinLink::principals(AtomSpace* as,
354354 // If we are here, the expression had variables in it.
355355 // Perform a search to ground those.
356356 AtomSpacePtr scratch = createAtomSpace(as);
357 scratch->set_copy_on_write();
357358 Handle meet = scratch->add_atom(_meet);
358359 ValuePtr vp = meet->execute();
359360 scratch->clear();
……@@ -604,6 +605,7 @@ HandleSet JoinLink::constrain(AtomSpace* as, bool silent,
604605{
605606 HandleSet rejects;
606607 AtomSpacePtr scratch = createAtomSpace(as);
608 scratch->set_copy_on_write();
607609
608610 for (const Handle& h : trav.containers)
609611 {
opencog/atoms/value/FutureStream.cc +6 -0
……@@ -83,8 +83,14 @@ void FutureStream::init(void)
8383 }
8484
8585 _scratch = createAtomSpace(_formula[0]->getAtomSpace());
86 _scratch->set_copy_on_write();
8687}
8788
89FutureStream::~FutureStream()
90{
91 // Can't leave the scratch space hanging around...
92 _formula[0]->getAtomSpace()->remove_atom(HandleCast(_scratch), true);
93}
8894
8995// ==============================================================
9096
opencog/atoms/value/FutureStream.h +1 -1
……@@ -53,7 +53,7 @@ public:
5353 FutureStream(const Handle&);
5454 FutureStream(const HandleSeq&&);
5555 FutureStream(const ValueSeq&);
56 virtual ~FutureStream() {}
56 virtual ~FutureStream() override;
5757
5858 /** Returns a string representation of the value. */
5959 virtual std::string to_string(const std::string& indent = "") const;
opencog/atoms/value/RelationalValue.cc +3 -0
……@@ -33,6 +33,8 @@ RelationalValue::RelationalValue(Type t, const Handle& schema)
3333
3434RelationalValue::~RelationalValue()
3535{
36 // Can't leave the scratch space hanging around...
37 _schema->getAtomSpace()->remove_atom(HandleCast(_scratch), true);
3638}
3739
3840// ==============================================================
……@@ -67,6 +69,7 @@ void RelationalValue::init_schema(void)
6769 // the AtomSpace in which the schema lives, and thus the schema has
6870 // access to this, to use as context.
6971 _scratch = createAtomSpace(_schema->getAtomSpace());
72 _scratch->set_copy_on_write();
7073}
7174
7275// ==============================================================