X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/ce24e1d22d120e6613f3cd1e04d81135f3d048c9..c2a1184ee0eb1c3638592a786e93fbf4b6f53493:/src/btree_data.cpp diff --git a/src/btree_data.cpp b/src/btree_data.cpp index bf92909..70195fd 100644 --- a/src/btree_data.cpp +++ b/src/btree_data.cpp @@ -24,8 +24,10 @@ BTreeData::BTreeData (Clave *k, uint child) BTreeData::~BTreeData () { - if (clave) + if (clave) { delete clave; + clave = NULL; + } } uint BTreeData::Size () const @@ -68,7 +70,7 @@ bool BTreeData::Abrev (BTreeData *anterior) if (anterior == NULL) return false; ClaveVariable *c = (ClaveVariable *)clave; - return c->Abrev (dynamic_cast(anterior->getClave ())); + return c->Abrev (dynamic_cast(anterior->GetKey ())); } bool BTreeData::DesAbrev (BTreeData *anterior) @@ -76,7 +78,7 @@ bool BTreeData::DesAbrev (BTreeData *anterior) if (anterior == NULL) return false; ClaveVariable *c = (ClaveVariable *)clave; - return c->DesAbrev (dynamic_cast(anterior->getClave ())); + return c->DesAbrev (dynamic_cast(anterior->GetKey ())); } BTreeLeafData::BTreeLeafData (uchar *node, int key_type) @@ -89,6 +91,10 @@ BTreeLeafData::BTreeLeafData (uchar *node, int key_type) BTreeLeafData::~BTreeLeafData () { + if (clave) { + delete clave; + clave = NULL; + } } uint BTreeLeafData::Size () const