Permalink
Browse files

Fix a memory leak in Undo log.

  • Loading branch information...
1 parent 6c4c67c commit f77f8d086a9830f288d2ecc6499b26a7136556cc @malin1993ml malin1993ml committed Nov 2, 2015
@@ -17,6 +17,7 @@
#include <storage/PersistentTableUndoUpdateAction.h>
#include <cassert>
+#include "common/StringRef.h"
namespace voltdb {
@@ -64,10 +65,11 @@ void PersistentTableUndoUpdateAction::release() {
/*
* Free the strings from the old tuple that were updated.
*/
- for (std::vector<const char*>::iterator i = oldUninlineableColumns.begin();
+ for (std::vector<char*>::iterator i = oldUninlineableColumns.begin();
i != oldUninlineableColumns.end(); i++)
{
- delete [] (*i);
+ StringRef::destroy((StringRef*)(*i));
+ //delete [] (*i);
}
}
@@ -71,7 +71,7 @@ class PersistentTableUndoUpdateAction: public voltdb::UndoAction {
if (uninlineableObjectColumnCount > 0) {
for (uint16_t ii = 0; ii < uninlineableObjectColumnCount; ii++) {
const uint16_t uninlineableObjectColumn = schema->getUninlinedObjectColumnInfoIndex(ii);
- const char *mPtr = *reinterpret_cast<char* const*>
+ char *mPtr = *reinterpret_cast<char**>
(m_oldTuple.getDataPtr(uninlineableObjectColumn));
const char *oPtr = *reinterpret_cast<char* const*>
(m_newTuple.getDataPtr(uninlineableObjectColumn));
@@ -115,7 +115,7 @@ class PersistentTableUndoUpdateAction: public voltdb::UndoAction {
voltdb::TableTuple m_oldTuple;
voltdb::TableTuple m_newTuple;
voltdb::PersistentTable *m_table;
- std::vector<const char*> oldUninlineableColumns;
+ std::vector<char*> oldUninlineableColumns;
std::vector<const char*> newUninlineableColumns;
bool m_revertIndexes;
size_t m_wrapperOffset;

0 comments on commit f77f8d0

Please sign in to comment.