Skip to content

Commit fea0326

Browse files
authored
don't clear the array before deleting contents of the array (#1293)
1 parent 4cd0454 commit fea0326

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Tools/CmdLine/IccProfileVisualize/MiniPDF.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ void PDFWriter::CloseFile()
185185
return;
186186
}
187187

188-
m_objects.clear();
189188
}
190189
catch (const std::exception& e) {
191190
LogAnError(stderr, "PDF writing error in '%s': '%s'\n", m_filename.c_str(), e.what() );
@@ -197,7 +196,7 @@ void PDFWriter::CloseFile()
197196
m_filename.clear();
198197
}
199198

200-
// cleanup all the allocated objects
199+
// always cleanup all of the allocated objects
201200
for (auto &obj: m_objects ) {
202201
delete obj;
203202
obj = NULL;

0 commit comments

Comments
 (0)