Fix for issue 150 - HandleAllocator asserts on framebuffer 0 release
Issue=150
Signed-off-by: apatrick
git-svn-id: https://angleproject.googlecode.com/svn/trunk@633 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/common/version.h b/src/common/version.h
index 658d674..e7f3d97 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
-#define BUILD_REVISION 632
+#define BUILD_REVISION 633
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/libGLESv2/HandleAllocator.cpp b/src/libGLESv2/HandleAllocator.cpp
index cb36ac8..c498f8a 100644
--- a/src/libGLESv2/HandleAllocator.cpp
+++ b/src/libGLESv2/HandleAllocator.cpp
@@ -44,11 +44,20 @@
{
if (handle == mNextValue - 1)
{
- ASSERT(mBaseValue < mNextValue);
- mNextValue--;
- return;
+ // Don't drop below base value
+ if(mNextValue > mBaseValue)
+ {
+ mNextValue--;
+ }
}
- mFreeValues.push_back(handle);
+ else
+ {
+ // Only free handles that we own - don't drop below the base value
+ if (handle >= mBaseValue)
+ {
+ mFreeValues.push_back(handle);
+ }
+ }
}
}