| 1321 | } |
| 1322 | |
| 1323 | void DUChain::removeDocumentChain(TopDUContext* context) |
| 1324 | { |
| 1325 | ENSURE_CHAIN_WRITE_LOCKED; |
| 1326 | IndexedTopDUContext indexed(context->indexed()); |
| 1327 | Q_ASSERT(indexed.data() == context); ///This assertion fails if you call removeDocumentChain(..) on a document that has not been added to the du-chain |
| 1328 | context->m_dynamicData->deleteOnDisk(); |
| 1329 | Q_ASSERT(indexed.data() == context); |
| 1330 | sdDUChainPrivate->removeDocumentChainFromMemory(context); |
| 1331 | Q_ASSERT(!indexed.data()); |
| 1332 | Q_ASSERT(!environmentFileForDocument(indexed)); |
| 1333 | |
| 1334 | QMutexLocker lock(&sdDUChainPrivate->m_chainsMutex); |
| 1335 | sdDUChainPrivate->m_availableTopContextIndices.push_back(indexed.index()); |
| 1336 | } |
| 1337 | |
| 1338 | void DUChain::addDocumentChain(TopDUContext* chain) |
| 1339 | { |