From 7ce747d34d6af0171222ddbd5fcd80e5b55024c7 Mon Sep 17 00:00:00 2001
From: Jonas Kulla <Nyocurio@gmail.com>
Date: Sun, 20 Jul 2014 13:15:03 +0200
Subject: [PATCH] GLProperty: Assert proper stack usage

---
 src/glstate.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/glstate.h b/src/glstate.h
index a78d592..9f97fa1 100644
--- a/src/glstate.h
+++ b/src/glstate.h
@@ -25,10 +25,16 @@
 #include "etc.h"
 
 #include <stack>
+#include <assert.h>
 
 template<typename T>
 struct GLProperty
 {
+	~GLProperty()
+	{
+		assert(stack.size() == 0);
+	}
+
 	void init(const T &value)
 	{
 		current = value;