| … | … | @@ -159,7 +159,24 @@ Handle RocksStorage::decodeFrame(const std::string& senc) |
| 159 | 159 | AtomSpacePtr asp = createAtomSpace(oset); |
| 160 | 160 | asp->set_name(name); |
| 161 | 161 | asp->set_copy_on_write(); |
| 162 | | return HandleCast(asp); |
| 162 | |
| 163 | // Ugh. This feels slightly awkward, but I think it is correct. |
| 164 | // Add the current asp to the first parent; this will trigger a |
| 165 | // snowball that will install all the others too. It works this |
| 166 | // way because not all of the "parents" are actually AtomSpaces; |
| 167 | // they might be executable Atoms that return AtomSpaces. This |
| 168 | // is all handled in AtomSpace::install(). |
| 169 | Handle hasp = HandleCast(asp); |
| 170 | for (const Handle& parent : oset) |
| 171 | { |
| 172 | if (ATOM_SPACE == parent->get_type()) |
| 173 | { |
| 174 | AtomSpaceCast(parent)->add_atom(hasp); |
| 175 | break; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | return hasp; |
| 163 | 180 | } |
| 164 | 181 | |
| 165 | 182 | /// Return the AtomSpacePtr corresponding to fid. |