Skip to content

Commit

Permalink
Merge pull request #2933 from linas/altered-delete
Browse files Browse the repository at this point in the history
Alter the return values from extract_atom()
  • Loading branch information
linas committed Apr 20, 2022
2 parents f89fc43 + 28bd355 commit e4a67ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opencog/atomspace/AtomTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,14 @@ size_t AtomSpace::get_num_atoms_of_type(Type type, bool subclass) const

bool AtomSpace::extract_atom(const Handle& h, bool recursive)
{
if (nullptr == h) return false;

// Make sure the atom is fully resolved before we go about
// deleting it.
const Handle& handle(get_atom(h));

if (nullptr == handle) return false;
// Report success if its already gone.
if (nullptr == handle) return true;

// User asked for a non-recursive remove, and the
// atom is still referenced. So, do nothing.
Expand Down

0 comments on commit e4a67ab

Please sign in to comment.