MCPcopy Create free account
hub / github.com/TeXworks/texworks / clearPages

Method clearPages

modules/QtPDF/src/PDFBackend.cpp:256–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void Document::clearPages()
257{
258 // Clear the processing thread to ensure no task still needs the pages we are
259 // about to destroy.
260 // NB: Do this before acquiring _docLock. See clearWorkStack() documentation.
261 // This should not cause any problems as we are supposed to currently be in
262 // the main (GUI) thread, and only this thread is supposed to add items to the
263 // work stack.
264 _processingThread.clearWorkStack();
265
266 QWriteLocker docLocker(_docLock.data());
267 foreach(QSharedPointer<Page> page, _pages) {
268 if (page.isNull())
269 continue;
270 page->detachFromParent();
271 }
272 // Note: clear() releases all QSharedPointer to pages, thereby destroying them
273 // (if they are not used elsewhere)
274 _pages.clear();
275}
276
277void Document::clearMetaData()
278{

Callers 1

reinitializeSceneMethod · 0.45

Calls 3

clearWorkStackMethod · 0.80
dataMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected