Bug 904483 - Fix out of order destruction problem when destroying GrContext. r=mattwoodrow, a=bajaj
authorGeorge Wright <gwright@mozilla.com>
Mon, 25 Nov 2013 20:37:50 -0500
changeset 166655 881c0899f01326becf25f56e052b31c5cdbb354b
parent 166654 ec081a4840ca07a399158f89c507655305c01d28
child 166656 9dc220412fa7aab1131eddfc86a7a9d0c23d4f38
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, bajaj
bugs904483
milestone27.0a2
Bug 904483 - Fix out of order destruction problem when destroying GrContext. r=mattwoodrow, a=bajaj
gfx/skia/src/gpu/GrContext.cpp
--- a/gfx/skia/src/gpu/GrContext.cpp
+++ b/gfx/skia/src/gpu/GrContext.cpp
@@ -131,22 +131,22 @@ bool GrContext::init(GrBackend backend, 
     return true;
 }
 
 int GrContext::GetThreadInstanceCount() {
     return THREAD_INSTANCE_COUNT;
 }
 
 GrContext::~GrContext() {
+    this->flush();
+
     for (int i = 0; i < fCleanUpData.count(); ++i) {
         (*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo);
     }
 
-    this->flush();
-
     // Since the gpu can hold scratch textures, give it a chance to let go
     // of them before freeing the texture cache
     fGpu->purgeResources();
 
     delete fTextureCache;
     fTextureCache = NULL;
     delete fFontCache;
     delete fDrawBuffer;