summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ImplicitContextI.cpp
diff options
context:
space:
mode:
authorBrent Eagles <brent@zeroc.com>2007-02-06 00:38:49 +0000
committerBrent Eagles <brent@zeroc.com>2007-02-06 00:38:49 +0000
commit193a03a2e0987442269f8498a986cb8354c75721 (patch)
tree73ac99a76cee5812e7b82738ddf6e3410f771da4 /cpp/src/Ice/ImplicitContextI.cpp
parentAdded Ruby (diff)
downloadice-193a03a2e0987442269f8498a986cb8354c75721.tar.bz2
ice-193a03a2e0987442269f8498a986cb8354c75721.tar.xz
ice-193a03a2e0987442269f8498a986cb8354c75721.zip
fix x64 warnings
Diffstat (limited to 'cpp/src/Ice/ImplicitContextI.cpp')
-rw-r--r--cpp/src/Ice/ImplicitContextI.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/cpp/src/Ice/ImplicitContextI.cpp b/cpp/src/Ice/ImplicitContextI.cpp
index 7dd27c0fada..a2991b12e14 100644
--- a/cpp/src/Ice/ImplicitContextI.cpp
+++ b/cpp/src/Ice/ImplicitContextI.cpp
@@ -508,12 +508,26 @@ PerThreadImplicitContext::clearThreadContext() const
delete (*sv)[_index].context;
(*sv)[_index].context = 0;
- int i = sv->size() - 1;
- while(i >= 0 && (*sv)[i].context == 0)
+ //
+ // Trim tailing empty contexts.
+ //
+ size_t i = sv->size();
+
+ bool clear = true;
+ while(i != 0)
{
i--;
+ if((*sv)[i].context != 0)
+ {
+ clear = false;
+ break;
+ }
}
- if(i < 0)
+
+ //
+ // If we did not find any contexts, delete the SlotVector.
+ //
+ if(clear)
{
delete sv;
#ifdef _WIN32