Steps to reproduce: * Load http://mobile.carrefour.fr/pdf/guide-achat.pdf at page 1 and navigate to page 4. * Load the same document directly at page 4 and navigate to page 6. Actual results: In the first case, many letters are missing from page 4 due to an incomplete (older revision) of a partial font being loaded. In the second case, page 4 renders just fine but the same issue applies to page 6. See http://code.google.com/p/sumatrapdf/source/detail?r=1922 for a patch.
Well, http://code.google.com/p/sumatrapdf/source/detail?r=1923 would be the version which actually works...
A variation of the same issue can be found at http://drop.io/mdj12345 (from http://code.google.com/p/sumatrapdf/issues/detail?id=936 ): in this document, the object numbers of old xrefs are re-used, but due to the fact that pdf_readnewxref works backwards, the table entries are overwritten nonetheless. See http://code.google.com/p/sumatrapdf/source/detail?r=1924 for a patch for this second issue.
I've pushed patches that fix the xref table clobbering in both of these cases.
FYI: Your first fix introduced a memory leak due to unused objects not being dropped.