Skip to content

Commit

Permalink
COMMON: Use PtrVector to store the memos data in FoxPro
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent 429e9e8 commit 787508f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/common/foxpro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ FoxPro::FoxPro() : _hasIndex(false), _hasMemo(false), _memoBlockSize(512) {
}

FoxPro::~FoxPro() {
for (std::vector<byte *>::iterator it = _memos.begin(); it != _memos.end(); ++it)
delete[] *it;
}

void FoxPro::load(SeekableReadStream *dbf, SeekableReadStream *cdx,
Expand Down
5 changes: 2 additions & 3 deletions src/common/foxpro.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
#ifndef COMMON_FOXPRO_H
#define COMMON_FOXPRO_H

#include <vector>

#include <boost/noncopyable.hpp>

#include "src/common/types.h"
#include "src/common/ptrlist.h"
#include "src/common/ptrvector.h"
#include "src/common/ustring.h"

namespace Common {
Expand Down Expand Up @@ -141,7 +140,7 @@ class FoxPro : boost::noncopyable {
PtrList<byte, DeallocatorArray> _pool;

uint16 _memoBlockSize;
std::vector<byte *> _memos;
PtrVector<byte, DeallocatorArray> _memos;

// Loading helpers
void loadHeader (SeekableReadStream &dbf, uint32 &recordSize, uint32 &recordCount,
Expand Down

0 comments on commit 787508f

Please sign in to comment.