Commit ad312dbd authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix memory leaks in PageLabelInfo.cc

parent b45ad9f3
2005-07-28 Albert Astals Cid <aacid@kde.org>
* poppler/PageLabelInfo.[cc|h]: Fix memory leaks
2005-07-28 Albert Astals Cid <aacid@kde.org>
* glib/poppler-document.cc:
......
......@@ -171,6 +171,10 @@ PageLabelInfo::Interval::Interval(Object *dict, int baseA) {
base = baseA;
}
PageLabelInfo::Interval::~Interval() {
gfree(prefix);
}
PageLabelInfo::PageLabelInfo(Object *tree, int numPages) {
int i;
Interval *interval, *next;
......@@ -189,6 +193,13 @@ PageLabelInfo::PageLabelInfo(Object *tree, int numPages) {
}
}
PageLabelInfo::~PageLabelInfo() {
int i;
for (i = 0; i < intervals.getLength(); ++i) {
delete (Interval*)intervals.get(i);
}
}
void PageLabelInfo::parse(Object *tree) {
Object nums, obj;
Object kids, kid, limits, low, high;
......
......@@ -12,6 +12,7 @@
class PageLabelInfo {
public:
PageLabelInfo(Object *tree, int numPages);
~PageLabelInfo();
GBool labelToIndex(GooString *label, int *index);
GBool indexToLabel(int index, GooString *label);
......@@ -21,6 +22,7 @@ private:
private:
struct Interval {
Interval(Object *dict, int baseA);
~Interval();
char *prefix;
enum NumberStyle {
None,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment