From b85925bcd547d26ad2a8af162d240b465e98ac1e Mon Sep 17 00:00:00 2001
From: Andy Cedilnik <andy.cedilnik@kitware.com>
Date: Mon, 19 Sep 2005 16:19:57 -0400
Subject: [PATCH] BUG: Remove warning and try to fix memory problem

---
 Registry.cxx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Registry.cxx b/Registry.cxx
index d11db560..2097085f 100644
--- a/Registry.cxx
+++ b/Registry.cxx
@@ -367,6 +367,11 @@ RegistryHelper::~RegistryHelper()
 bool RegistryHelper::Open(const char *toplevel, const char *subkey,
   int readonly)
 {  
+  this->EntriesMap.erase(
+    this->EntriesMap.begin(),
+    this->EntriesMap.end());
+  m_Empty = 1;
+
 #ifdef _WIN32
   if ( m_RegistryType == Registry::WIN32_REGISTRY)
     {
@@ -493,10 +498,6 @@ bool RegistryHelper::Close()
     {
     if ( !m_Changed )
       {
-      this->EntriesMap.erase(
-        this->EntriesMap.begin(),
-        this->EntriesMap.end());
-      m_Empty = 1;
       this->SetSubKey(0);
       return true;
       }
@@ -786,7 +787,7 @@ kwsys_stl::string RegistryHelper::DecodeValue(const char* str)
   kwsys_ios::ostringstream ostr;
   while ( *str )
     {
-    int val;
+    unsigned int val;
     switch ( *str )
       {
     case '%':
-- 
GitLab