Skip to content

Commit

Permalink
make sure to clear SQLite insertion patch
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Jul 31, 2017
1 parent 40a1d82 commit 55297ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions plugins/sqlite/io/SQLiteCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ class Patch

size_t byte_size()
{ return buf.size(); }

void clear()
{
buf.clear();
count = 0;
remaining = 0;
idx = 0;
}
};
typedef std::shared_ptr<Patch> PatchPtr;

Expand Down
3 changes: 1 addition & 2 deletions plugins/sqlite/io/SQLiteWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,6 @@ void SQLiteWriter::writeTile(const PointViewPtr view)
{
using namespace std;

Patch outpatch;

if (m_doCompression)
{
#ifdef PDAL_HAVE_LAZPERF
Expand Down Expand Up @@ -528,6 +526,7 @@ void SQLiteWriter::writeTile(const PointViewPtr view)
rs.push_back(r);
m_session->insert(m_block_insert_query.str(), rs);
m_block_id++;
m_patch->clear();

}

Expand Down

0 comments on commit 55297ac

Please sign in to comment.