mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 19:10:20 +01:00
fixed GH #1532: RecordSet and RowFilter: bad use of reference counter
This commit is contained in:
@@ -41,7 +41,6 @@ RecordSet::RecordSet(const Statement& rStatement,
|
||||
_currentRow(0),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
_pEnd(new RowIterator(this, true)),
|
||||
_pFilter(0),
|
||||
_totalRowCount(UNKNOWN_TOTAL_ROW_COUNT)
|
||||
{
|
||||
if (pRowFormatter) setRowFormatter(pRowFormatter);
|
||||
@@ -55,7 +54,6 @@ RecordSet::RecordSet(Session& rSession,
|
||||
_currentRow(0),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
_pEnd(new RowIterator(this, true)),
|
||||
_pFilter(0),
|
||||
_totalRowCount(UNKNOWN_TOTAL_ROW_COUNT)
|
||||
{
|
||||
if (pRowFormatter) setRowFormatter(pRowFormatter);
|
||||
@@ -70,7 +68,6 @@ RecordSet::RecordSet(const RecordSet& other):
|
||||
_pFilter(other._pFilter),
|
||||
_totalRowCount(other._totalRowCount)
|
||||
{
|
||||
if (_pFilter) _pFilter->duplicate();
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +77,6 @@ RecordSet::~RecordSet()
|
||||
{
|
||||
delete _pBegin;
|
||||
delete _pEnd;
|
||||
if (_pFilter) _pFilter->release();
|
||||
|
||||
RowMap::iterator it = _rowMap.begin();
|
||||
RowMap::iterator end = _rowMap.end();
|
||||
@@ -377,11 +373,9 @@ std::ostream& RecordSet::copy(std::ostream& os, std::size_t offset, std::size_t
|
||||
}
|
||||
|
||||
|
||||
void RecordSet::filter(RowFilter* pFilter)
|
||||
void RecordSet::filter(const Poco::AutoPtr<RowFilter>& pFilter)
|
||||
{
|
||||
if (_pFilter) _pFilter->release();
|
||||
_pFilter = pFilter;
|
||||
if (_pFilter) _pFilter->duplicate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user