From 0e81c0b2aa8496bc7d0d069ba72ee05314a27f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 20 Feb 2014 22:04:50 -0800 Subject: [PATCH] Fixed 08-update example. --- examples/08-update/update.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index 3a3cfe933..7917f5cda 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -465,6 +465,11 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::frame(); } + // texture2dData is managed from main thread, and it's passed to renderer + // just as MemoryRef. At this point render might be using it. We must wait + // previous frame to finish before we can free it. + bgfx::frame(); + // Cleanup. free(texture2dData);