From 54ab047f73c160ef17787bfa052600f99e1f10bc Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 23 Jul 2014 09:10:16 +1000 Subject: [PATCH] Fix the order of destruction. The draw target must be released before the gl context, as gl resources are present. --- azure_hl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_hl.rs b/azure_hl.rs index 08652f6..f451b90 100644 --- a/azure_hl.rs +++ b/azure_hl.rs @@ -327,11 +327,11 @@ pub struct DrawTarget { impl Drop for DrawTarget { fn drop(&mut self) { unsafe { + AzReleaseDrawTarget(self.azure_draw_target); match self.skia_context { None => {} Some(ctx_ref) => { AzReleaseSkiaSharedGLContext(ctx_ref); } } - AzReleaseDrawTarget(self.azure_draw_target); } } }