diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp
index 240c012..6fd4788 100644
--- a/src/qml/qml/qqmlapplicationengine.cpp
+++ b/src/qml/qml/qqmlapplicationengine.cpp
@@ -51,7 +51,10 @@ QQmlApplicationEnginePrivate::~QQmlApplicationEnginePrivate()
 
 void QQmlApplicationEnginePrivate::cleanUp()
 {
-    qDeleteAll(objects);
+    foreach (QObject *o, objects) {
+        qDebug() << __FUNCTION__ << "deleting" << o;
+        delete o;
+    }
 #ifndef QT_NO_TRANSLATION
     qDeleteAll(translators);
 #endif
@@ -233,7 +236,9 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QString &filePath, QObject *p
 QQmlApplicationEngine::~QQmlApplicationEngine()
 {
     Q_D(QQmlApplicationEngine);
+    qDebug() << __FUNCTION__<< '>';
     d->cleanUp();//Instantiated root objects must be deleted before the engine
+    qDebug() << __FUNCTION__ << '<';
 }
 
 /*!
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 0101e0e..0c5dcb2 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -4031,6 +4031,7 @@ QQuickContext2D::~QQuickContext2D()
             m_glContext->makeCurrent(m_surface.data());
             delete m_texture;
             m_glContext->doneCurrent();
+            qDebug() << __FUNCTION__ << "deleting m_glContext" << m_glContext;
             delete m_glContext;
         } else if (m_texture->isOnCustomThread()) {
             Q_ASSERT(m_glContext);
@@ -4126,6 +4127,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
          m_surface->setFormat(window->format());
          m_surface->create();
          m_glContext = new QOpenGLContext;
+         qDebug() << __FUNCTION__ << "creating m_glContext" << m_glContext;
          m_glContext->setFormat(cc->format());
          m_glContext->setShareContext(cc);
          if (renderThread != QThread::currentThread())
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h
index 3ff0cb1..f6b853e 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h
@@ -106,6 +106,7 @@ public:
     bool event(QEvent *e);
 
     void initializeOpenGL(QOpenGLContext *gl, QOffscreenSurface *s) {
+        qDebug() << __FUNCTION__ << gl;
         m_gl = gl;
         m_surface = s;
     }
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 90102f1..2c4db49 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -535,6 +535,7 @@ QSGRenderContext::QSGRenderContext(QSGContext *context)
 
 QSGRenderContext::~QSGRenderContext()
 {
+    qDebug() << __FUNCTION__;
     invalidate();
 }
 
@@ -644,6 +645,7 @@ void QSGRenderContext::initialize(QOpenGLContext *context)
 
     Q_ASSERT_X(!m_gl, "QSGRenderContext::initialize", "already initialized!");
     m_gl = context;
+    qDebug() << __FUNCTION__ << "m_gl" << m_gl;
     if (m_attachToGLContext) {
         Q_ASSERT(!context->property(QSG_RENDERCONTEXT_PROPERTY).isValid());
         context->setProperty(QSG_RENDERCONTEXT_PROPERTY, QVariant::fromValue(this));
@@ -711,11 +713,13 @@ void QSGRenderContext::invalidate()
     delete m_depthStencilManager;
     m_depthStencilManager = 0;
 
+    qDebug() << __FUNCTION__ << "deleting " << m_distanceFieldCacheManager;
     delete m_distanceFieldCacheManager;
     m_distanceFieldCacheManager = 0;
 
     if (m_gl->property(QSG_RENDERCONTEXT_PROPERTY) == QVariant::fromValue(this))
         m_gl->setProperty(QSG_RENDERCONTEXT_PROPERTY, QVariant());
+    qDebug() << __FUNCTION__ << "releasing m_gl" << m_gl;
     m_gl = 0;
 
     m_sg->renderContextInvalidated(this);
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index 093e84b..99aa1b5 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -72,14 +72,20 @@ QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QSGDistance
 
 QSGDefaultDistanceFieldGlyphCache::~QSGDefaultDistanceFieldGlyphCache()
 {
-    for (int i = 0; i < m_textures.count(); ++i)
+    qDebug() << __FUNCTION__ << '>' << "QOpenGLContext::currentContext()="
+             << QOpenGLContext::currentContext();
+
+    for (int i = 0; i < m_textures.count(); ++i) {
+        qDebug() << __FUNCTION__ << "glDeleteTextures" << i;
         m_funcs->glDeleteTextures(1, &m_textures[i].texture);
+    }
 
     if (m_fboGuard != 0)
         m_fboGuard->free();
 
     delete m_blitProgram;
     delete m_areaAllocator;
+    qDebug() << __FUNCTION__ << '<';
 }
 
 void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet<glyph_t> &glyphs)
