From 34ad058e6f661d41b843ab44d1f2dcae8f77a5e1 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 27 Nov 2006 02:58:55 +0000 Subject: [PATCH] Fix de bug que hacia morira con SIGSEGV al test de C++. --- trunk/src/indicemagico.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/trunk/src/indicemagico.h b/trunk/src/indicemagico.h index 4c3396e..7b28472 100644 --- a/trunk/src/indicemagico.h +++ b/trunk/src/indicemagico.h @@ -24,8 +24,8 @@ public: CIndiceMagico() { m_cant = 0 ; - m_nombres = (std::string*)calloc(sizeof(std::string), MAX_ELEMENTOS) ; - m_datos = (T*)calloc(sizeof(m_datos), MAX_ELEMENTOS) ; + m_nombres = new std::string[MAX_ELEMENTOS]; + m_datos = new T[MAX_ELEMENTOS]; if (!m_nombres) @@ -36,6 +36,12 @@ public: } + ~CIndiceMagico() + { + delete m_nombres; + delete m_datos; + } + public: void add(const char* nombre, const T dato) { -- 2.43.0