Changeset 250 for trunk/src/IDocument.cxx
- Timestamp:
- 07/18/06 15:50:44 (2 years ago)
- Files:
-
- 1 modified
-
trunk/src/IDocument.cxx (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IDocument.cxx
r222 r250 277 277 IDocument::notifyLoad () 278 278 { 279 // Empty the cache to avoid displaying pages from previous file. 280 clearCache (); 279 281 // Add the two first pages, if they exists, to the cache. 280 282 addPageToCache (1); … … 723 725 { 724 726 if ( NULL == m_Format ) 725 { 727 { 726 728 return ""; 727 729 } … … 1366 1368 job->setPageNumber (pageNum); 1367 1369 IJob::enqueue (job); 1368 1370 1369 1371 G_LOCK (pageSearch); 1370 1372 // Check which cached page to drop. … … 1417 1419 G_LOCK (pageSearch); 1418 1420 PageCache *cached = NULL; 1419 for ( GList *page = g_list_first (m_PageCache) ; 1421 for ( GList *page = g_list_first (m_PageCache) ; 1420 1422 NULL != page && NULL == cached ; 1421 1423 page = g_list_next (page) ) … … 1443 1445 gint pageCount = g_list_length (m_PageCache); 1444 1446 guint32 minAge = G_MAXUINT32; 1445 for ( GList *page = g_list_first (m_PageCache) ; 1447 for ( GList *page = g_list_first (m_PageCache) ; 1446 1448 NULL != page ; 1447 1449 page = g_list_next (page) ) … … 1476 1478 IDocument::clearCache () 1477 1479 { 1480 G_LOCK (pageSearch); 1478 1481 // Delete all cached pages. 1479 for ( GList *page = g_list_first (m_PageCache) ; 1482 for ( GList *page = g_list_first (m_PageCache) ; 1480 1483 NULL != page ; 1481 1484 page = g_list_next (page) ) 1482 1485 { 1483 1486 PageCache *cachedPage = (PageCache *)page->data; 1487 G_LOCK (pageImage); 1484 1488 delete cachedPage->pageImage; 1489 G_UNLOCK (pageImage); 1485 1490 delete cachedPage; 1486 1491 } 1487 1492 g_list_free (m_PageCache); 1493 m_PageCache = NULL; 1494 G_UNLOCK (pageSearch); 1488 1495 } 1489 1496
