diff options
Diffstat (limited to 'printing')
-rw-r--r-- | printing/emf_win.cc | 5 | ||||
-rw-r--r-- | printing/emf_win.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/printing/emf_win.cc b/printing/emf_win.cc index d9472f9..b6c9b4f 100644 --- a/printing/emf_win.cc +++ b/printing/emf_win.cc @@ -169,9 +169,14 @@ Emf::Emf() : emf_(NULL), hdc_(NULL), page_count_(0) { } Emf::~Emf() { + Close(); +} + +void Emf::Close() { DCHECK(!hdc_); if (emf_) DeleteEnhMetaFile(emf_); + emf_ = NULL; } bool Emf::InitToFile(const base::FilePath& metafile_path) { diff --git a/printing/emf_win.h b/printing/emf_win.h index fa27409..e31e204 100644 --- a/printing/emf_win.h +++ b/printing/emf_win.h @@ -42,6 +42,9 @@ class PRINTING_EXPORT Emf : public Metafile { Emf(); virtual ~Emf(); + // Closes metafile. + void Close(); + // Generates a new metafile that will record every GDI command, and will // be saved to |metafile_path|. virtual bool InitToFile(const base::FilePath& metafile_path); |