Destroy the components in the inverse order of the way we've created
them. Waffle's WGL backend actually creates the window at
config_choose() time, and displays/hides it at create/destroy time.

If we don't follow the correct order the window is destroyed at
config_destroy() and hiding it at window_destroy will trigger an
assert.

Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com>
---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 143a204..03a7a9b 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -468,12 +468,12 @@ special_case_gl31(struct piglit_wfl_framework *wfl_fw,
                    "profile if context creation succeeds.",
                    context_description, error_verb);
 
-       waffle_config_destroy(wfl_fw->config);
-       waffle_context_destroy(wfl_fw->context);
        waffle_window_destroy(wfl_fw->window);
-       wfl_fw->config = NULL;
-       wfl_fw->context = NULL;
+       waffle_context_destroy(wfl_fw->context);
+       waffle_config_destroy(wfl_fw->config);
        wfl_fw->window = NULL;
+       wfl_fw->context = NULL;
+       wfl_fw->config = NULL;
 
        return make_context_current_singlepass(
                        wfl_fw, &fallback_config, flavor,
-- 
2.0.2

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to