From c715b258e2d486ee4d95da7d495fd1567770fdf6 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 21 Jun 2010 15:12:50 +0000 Subject: Both Bu::Variant and Bu::MiniCron failed to cleanup behind themselves in some cases. This has been fixed. --- src/minicron.cpp | 4 ++++ src/variant.cpp | 5 +++++ src/variant.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/minicron.cpp b/src/minicron.cpp index 35df189..8aace26 100644 --- a/src/minicron.cpp +++ b/src/minicron.cpp @@ -17,6 +17,10 @@ Bu::MiniCron::MiniCron() : Bu::MiniCron::~MiniCron() { + while( !hJobs.isEmpty() ) + { + delete hJobs.dequeue(); + } } bool Bu::MiniCron::hasJobs() diff --git a/src/variant.cpp b/src/variant.cpp index 9665261..6b304ba 100644 --- a/src/variant.cpp +++ b/src/variant.cpp @@ -36,6 +36,11 @@ Bu::Variant::Variant( const Variant &v ) : Bu::Variant::~Variant() { + if( pCore ) + { + delete pCore; + pCore = NULL; + } } bool Bu::Variant::isSet() diff --git a/src/variant.h b/src/variant.h index 292ce56..1eda584 100644 --- a/src/variant.h +++ b/src/variant.h @@ -109,7 +109,7 @@ namespace Bu template Variant &operator=( const t &rhs ) { - if( pCore && pCore->getType() != typeid(t) ) + if( pCore ) // && pCore->getType() != typeid(t) ) { delete pCore; pCore = NULL; -- cgit v1.2.3