From 2aaa25020db0800ff647bf7e4fb806a8d727a819 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 28 Jul 2021 15:02:46 -0400 Subject: [PATCH] In the Window destructor, delete Fonts and Images from the cache before the NanoVG context is deleted. --- src/Window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Window.cpp b/src/Window.cpp index dccb5aa6..c4901e29 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -350,6 +350,10 @@ Window::~Window() { APP->scene->onContextDestroy(e); } + // Fonts and Images in the cache must be deleted before the NanoVG context is deleted + internal->fontCache.clear(); + internal->imageCache.clear(); + // nvgDeleteClone(fbVg); #if defined NANOVG_GL2