Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 12387086: Unwind PDFObject destructor calls into heap instead of stack. Notice: the order of the destructors … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPDFDevice.h" 10 #include "SkPDFDevice.h"
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 fFontGlyphUsage.reset(new SkPDFGlyphSetMap()); 637 fFontGlyphUsage.reset(new SkPDFGlyphSetMap());
638 } 638 }
639 } 639 }
640 640
641 void SkPDFDevice::cleanUp(bool clearFontUsage) { 641 void SkPDFDevice::cleanUp(bool clearFontUsage) {
642 fGraphicStateResources.unrefAll(); 642 fGraphicStateResources.unrefAll();
643 fXObjectResources.unrefAll(); 643 fXObjectResources.unrefAll();
644 fFontResources.unrefAll(); 644 fFontResources.unrefAll();
645 fShaderResources.unrefAll(); 645 fShaderResources.unrefAll();
646 SkSafeUnref(fAnnotations); 646 SkSafeUnref(fAnnotations);
647 SkSafeUnref(fResourceDict); 647
648 // Transfer ownership of fResourceDict to list.
649 SkTDArray<SkPDFObject*> list;
650 list.push(fResourceDict);
651 fResourceDict = NULL;
652
653 SkPDFObject::safeUnref(&list);
648 654
649 if (clearFontUsage) { 655 if (clearFontUsage) {
650 fFontGlyphUsage->reset(); 656 fFontGlyphUsage->reset();
651 } 657 }
652 } 658 }
653 659
654 uint32_t SkPDFDevice::getDeviceCapabilities() { 660 uint32_t SkPDFDevice::getDeviceCapabilities() {
655 return kVector_Capability; 661 return kVector_Capability;
656 } 662 }
657 663
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 } 1726 }
1721 1727
1722 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, 1728 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
1723 SkCanvas::Config8888) { 1729 SkCanvas::Config8888) {
1724 return false; 1730 return false;
1725 } 1731 }
1726 1732
1727 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { 1733 bool SkPDFDevice::allowImageFilter(SkImageFilter*) {
1728 return false; 1734 return false;
1729 } 1735 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698